public class MessagingServices extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_TOPIC
Error topic string
|
static String |
MESSAGE_TOPIC
Message topic string
|
static String |
SUBSCRIBER_QUEUE
Subscriber Queue name
|
| Modifier and Type | Method and Description |
|---|---|
static MessagingServices |
getInstance()
Get messaging service instance
|
javax.jms.Connection |
newConnection()
Establish a new JMS Connection to the local broker
|
javax.jms.Session |
newSession()
Establish a new JMS Session on an existing connection to the local broker
|
void |
onEvent(Map<String,String> param)
To put events to subscriber queue
|
void |
publishMessage(String name,
String msg)
Sends a textual message to the named topic of the local broker.
|
void |
publishMessage(String brokerUrl,
String name,
String msg)
Sends a textual message to the named topic on any broker.
|
void |
queueMessage(String name,
String msg)
Sends a textual message to a named JMS queue on the local broker
|
void |
queueMessage(String brokerUrl,
String name,
String msg)
Sends a textual message to a named JMS queue on any broker.
|
void |
release()
Closes the JMS connections.
|
void |
sendMessage(String brokerUrl,
javax.jms.Destination destination,
javax.jms.TextMessage msg)
Sends a JMS message to an instantiated JMS destination.
|
public static final String SUBSCRIBER_QUEUE
public static final String ERROR_TOPIC
public static final String MESSAGE_TOPIC
public static MessagingServices getInstance() throws MessagingException
javax.jms.JMSException - if an error occurred starting the JMS connectionsMessagingExceptionpublic javax.jms.Connection newConnection()
throws MessagingException
MessagingException - if an error occurspublic javax.jms.Session newSession()
throws MessagingException
MessagingException - if an error occurspublic void release()
public void publishMessage(String name, String msg) throws MessagingException
name - The topic to send tomsg - The message to sendMessagingException - If any errors occur in resolving the
destination or sending.public void publishMessage(String brokerUrl, String name, String msg) throws MessagingException
brokerUrl - The broker to send toname - The topic to send tomsg - The message to sendMessagingException - If any errors occur in resolving the
destination or sending.public void queueMessage(String name, String msg) throws MessagingException
name - The queue to send tomsg - The message to sendMessagingException - If any errors occur in resolving the
destination or sending.public void queueMessage(String brokerUrl, String name, String msg) throws MessagingException
brokerUrl - The broker to send toname - The queue to send tomsg - The message to sendMessagingException - If any errors occur in resolving the
destination or sending.public void sendMessage(String brokerUrl, javax.jms.Destination destination, javax.jms.TextMessage msg) throws MessagingException
brokerUrl - The broker with an existing producer to use in sendingdestination - The destination to send tomsg - The message to sendMessagingException - If an error occurs when attempting to sendpublic void onEvent(Map<String,String> param) throws MessagingException
oid - Object ideventType - type of events happenedcontext - where the event happenedjsonFile - Configuration fileMessagingExceptionCopyright © 2009-2013. All Rights Reserved.