public class JMSClientUtil extends Object
Constructor and Description |
---|
JMSClientUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getEventFilePath(String sampleNumber,
String format,
String topic,
String filePath)
This method will construct the directory path of the data file
|
static void |
publishMapMessage(javax.jms.MessageProducer producer,
javax.jms.Session session,
List<String> messagesList)
Each message will be divided into groups and create the map message
|
static void |
publishTextMessage(javax.jms.MessageProducer producer,
javax.jms.Session session,
List<String> messagesList)
Each message will be divided into groups and create the map message
|
static List<String> |
readFile(String filePath)
Messages will be read from the given filepath and stored in the array list (messagesList)
|
public static String getEventFilePath(String sampleNumber, String format, String topic, String filePath) throws Exception
sampleNumber
- Number of the sample which is running currentlyformat
- Format of the file (ex: csv, txt)topic
- topic of the message to be sent (the data file should be named with the topic)filePath
- file path if a sample if not runningException
public static List<String> readFile(String filePath)
filePath
- Text file to be readpublic static void publishMapMessage(javax.jms.MessageProducer producer, javax.jms.Session session, List<String> messagesList) throws IOException, javax.jms.JMSException
producer
- Used for sending messages to a destinationsession
- Used to produce the messages to be sentmessagesList
- List of messages to be sent
individual message event data should be in
"attributeName(attributeType):attributeValue" formatIOException
javax.jms.JMSException
public static void publishTextMessage(javax.jms.MessageProducer producer, javax.jms.Session session, List<String> messagesList) throws javax.jms.JMSException
producer
- Used for sending messages to a destinationsession
- Used to produce the messages to be sentmessagesList
- List of messages to be sentjavax.jms.JMSException
Copyright © 2016 WSO2 Inc. All rights reserved.