Class JmsMethods
- java.lang.Object
-
- io.toro.martini.JmsMethods
-
-
Constructor Summary
Constructors Constructor Description JmsMethods(io.toro.martini.jms.JmsPublisher.Factory jmsPublisherFactory)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidpublishBytes(String destinationName, byte[] bytes)Send an array of bytes to the JMS broker.static voidpublishBytes(String destinationName, byte[] bytes, Closure replyClosure)Send an array of bytes to the JMS broker.static voidpublishBytes(String destinationName, byte[] bytes, Map<String,Object> properties)Send an array of bytes to the JMS broker.static voidpublishObject(String destinationName, Serializable obj)Send a serializable object to the JMS broker.static voidpublishObject(String destinationName, Serializable obj, Closure replyClosure)Send a serializable object to the JMS broker.static voidpublishObject(String destinationName, Serializable obj, Map<String,Object> properties)Send a serializable object to the JMS broker.static voidpublishString(String destinationName, String string)Send a string to the JMS broker.static voidpublishString(String destinationName, String string, Closure replyClosure)Send a string to the JMS broker.static voidpublishString(String destinationName, String string, Map<String,Object> properties)Send a string to the JMS broker.static voidpublishTo(byte[] bytes, String destinationName)Send a string to the JMS broker.static voidpublishTo(byte[] bytes, String destinationName, Closure replyClosure)Send an array of bytes to the JMS broker.static voidpublishTo(byte[] bytes, String destinationName, Map properties)Send an array of bytes to the JMS broker.static voidpublishTo(Serializable obj, String destinationName)Send a serializable object to the JMS broker.static voidpublishTo(Serializable obj, String destinationName, Closure replyClosure)Send a serializable object to the JMS broker.static voidpublishTo(Serializable obj, String destinationName, Map<String,Object> properties)Send a serializable object to the JMS broker.static voidpublishTo(String string, String destinationName)Send a string to the JMS broker.static voidpublishTo(String string, String destinationName, Closure replyClosure)Send a string to the JMS broker.static voidpublishTo(String string, String destinationName, Map properties)Send a string to the JMS broker.static voidreplyTo(byte[] bytes, Message requestMessage)Send an array of bytes to the JMS broker.static voidreplyTo(byte[] bytes, Message requestMessage, Map<String,Object> properties)Send an array of bytes to the JMS broker.static voidreplyTo(Serializable obj, Message requestMessage)Send a serializable object to the JMS broker.static voidreplyTo(Serializable obj, Message requestMessage, Map<String,Object> properties)Send a serializable object to the JMS broker.static voidreplyTo(String string, Message requestMessage)Send a string to the JMS broker.static voidreplyTo(String string, Message requestMessage, Map<String,Object> properties)Send a string to the JMS broker.static voidreplyWith(Message requestMessage, byte[] bytes)Send an array of bytes to the JMS broker.static voidreplyWith(Message requestMessage, byte[] bytes, Map<String,Object> properties)Send an array of bytes to the JMS broker.static voidreplyWith(Message requestMessage, Serializable obj)Send a serializable object to the JMS broker.static voidreplyWith(Message requestMessage, Serializable obj, Map<String,Object> properties)Send a serializable object to the JMS broker.static voidreplyWith(Message requestMessage, String string)Send a string to the JMS broker.static voidreplyWith(Message requestMessage, String string, Map<String,Object> properties)Send a string to the JMS broker.static voidsendAlert(AlertJMSMessage alertJMSMessage)Send a message to the alert topic topic://io.toro.martini.alert.AlertQueue.static voidsendAlert(String message)Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.static voidsendAlert(String message, int severity)Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.static voidsendAlert(String message, String source)Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.static voidsendAlert(String message, String source, int severity)Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.static voidsendAlert(String message, String source, int severity, Map<Serializable,Serializable> properties)Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
-
-
-
Constructor Detail
-
JmsMethods
@Autowired JmsMethods(io.toro.martini.jms.JmsPublisher.Factory jmsPublisherFactory)
-
-
Method Detail
-
publishTo
public static void publishTo(Serializable obj, String destinationName) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world!' serializable.publishTo('queue://com.torocloud.example.HelloQueue')- Parameters:
obj- the object to senddestinationName- the name of the queue/topic to send the object to- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(Serializable obj, String destinationName, Closure replyClosure) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world!' serializable.publishTo('queue://com.torocloud.example.HelloQueue') { message -> println "Received a reply: ${message}" }- Parameters:
obj- the object to senddestinationName- the name of the queue/topic to send the object to- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(Serializable obj, String destinationName, Map<String,Object> properties) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world!' serializable.publishTo('queue://com.torocloud.example.HelloQueue', [ "property": "value" ])- Parameters:
obj- the object to senddestinationName- the name of the queue/topic to send the object toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(String string, String destinationName) throws JMSException
Send a string to the JMS broker.
Example usage:
'Hello, world!'.publishTo( 'queue://com.torocloud.example.HelloQueue' )
- Parameters:
string- the string to senddestinationName- the name of the queue/topic to send the object to- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(String string, String destinationName, Map properties) throws JMSException
Send a string to the JMS broker.
Example usage:
'Hello, world'.publishTo('queue://com.torocloud.example.HelloQueue', [ "property": "value" ])- Parameters:
string- the string to senddestinationName- the name of the queue/topic to send the object toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(String string, String destinationName, Closure replyClosure) throws JMSException
Send a string to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishString( 'Hello, world!' ){ println "Received a reply: ${message}" }- Parameters:
destinationName- the name of the queue/topic to send the object tostring- the string to send- Throws:
JMSException
-
publishTo
public static void publishTo(byte[] bytes, String destinationName) throws JMSExceptionSend a string to the JMS broker.
Example usage:
def bytes = new byte[]; ... bytes.publishTo( 'queue://com.torocloud.example.BytesQueue' )
- Parameters:
bytes- the array of bytes to senddestinationName- the name of the queue/topic to send the object to- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(byte[] bytes, String destinationName, Map properties) throws JMSExceptionSend an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... bytes.publishTo( 'queue://com.torocloud.example.BytesQueue' )
- Parameters:
bytes- the array of bytes to senddestinationName- the name of the queue/topic to send the object toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
publishTo
public static void publishTo(byte[] bytes, String destinationName, Closure replyClosure) throws JMSExceptionSend an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... bytes.publishTo( 'queue://com.torocloud.example.BytesQueue') { message -> println "Received a reply: ${message}" }- Parameters:
destinationName- the name of the queue/topic to send the object tobytes- the array of bytes to send- Throws:
JMSException
-
publishObject
public static void publishObject(String destinationName, Serializable obj, Map<String,Object> properties) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world!' 'queue://com.torocloud.example.HelloQueue'.publishObject(serializable, [ "property": "value" ])
- Parameters:
destinationName- the name of the queue/topic to send the object toobj- the object to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException
-
publishObject
public static void publishObject(String destinationName, Serializable obj) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishObject('Hello, world')- Parameters:
destinationName- the name of the queue/topic to send the object toobj- the object to send- Throws:
JMSException
-
publishObject
public static void publishObject(String destinationName, Serializable obj, Closure replyClosure) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishObject('Hello, world') { message -> println "Received a reply: ${message}" }- Parameters:
destinationName- the name of the queue/topic to send the object toobj- the object to send- Throws:
JMSException
-
publishString
public static void publishString(String destinationName, String string) throws JMSException
Send a string to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishString('Hello, world')- Parameters:
destinationName- the name of the queue/topic to send the object tostring- the string to send- Throws:
JMSException
-
publishString
public static void publishString(String destinationName, String string, Closure replyClosure) throws JMSException
Send a string to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishString('Hello, world') { message -> println "Received a reply: ${message}" }- Parameters:
destinationName- the name of the queue/topic to send the object tostring- the string to send- Throws:
JMSException
-
publishString
public static void publishString(String destinationName, String string, Map<String,Object> properties) throws JMSException
Send a string to the JMS broker.
Example usage:
'queue://com.torocloud.example.HelloQueue'.publishString('Hello, world', [ 'property': 'value' ])- Parameters:
destinationName- the name of the queue/topic to send the object tostring- the string to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException
-
publishBytes
public static void publishBytes(String destinationName, byte[] bytes) throws JMSException
Send an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... 'queue://com.torocloud.example.BytesQueue'.publishBytes( bytes )
- Parameters:
destinationName- the name of the queue/topic to send the object tobytes- the array of bytes to send- Throws:
JMSException
-
publishBytes
public static void publishBytes(String destinationName, byte[] bytes, Closure replyClosure) throws JMSException
Send an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... 'queue://com.torocloud.example.BytesQueue'.publishBytes( bytes ) { message -> println "Received a reply: ${message}" }- Parameters:
destinationName- the name of the queue/topic to send the object tobytes- the array of bytes to send- Throws:
JMSException
-
publishBytes
public static void publishBytes(String destinationName, byte[] bytes, Map<String,Object> properties) throws JMSException
Send an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... 'queue://com.torocloud.example.BytesQueue'.publishBytes( bytes, [ 'property': 'value' ] )
- Parameters:
destinationName- the name of the queue/topic to send the object tobytes- the array of bytes to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException
-
replyTo
public static void replyTo(Serializable obj, Message requestMessage) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world' serializable.replyTo( message )
- Parameters:
obj- the object to sendrequestMessage- the message to reply to- Throws:
JMSException- Since:
- 1.0
-
replyTo
public static void replyTo(Serializable obj, Message requestMessage, Map<String,Object> properties) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
'Hello, world'.replyTo( message, properties )
- Parameters:
obj- the object to sendrequestMessage- the message to reply toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
replyTo
public static void replyTo(String string, Message requestMessage) throws JMSException
Send a string to the JMS broker.
Example usage:
'Hello, world'.publishTo( message )
- Parameters:
string- the string to sendrequestMessage- the message to reply to- Throws:
JMSException- Since:
- 1.0
-
replyTo
public static void replyTo(String string, Message requestMessage, Map<String,Object> properties) throws JMSException
Send a string to the JMS broker.
Example usage:
'Hello, world'.replyTo( message, [ 'property': 'value' ] )
- Parameters:
string- the string to sendrequestMessage- the message to reply toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
replyTo
public static void replyTo(byte[] bytes, Message requestMessage) throws JMSExceptionSend an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... bytes.replyTo( message )
- Parameters:
bytes- the array of bytes to sendrequestMessage- the message to reply to- Throws:
JMSException- Since:
- 1.0
-
replyTo
public static void replyTo(byte[] bytes, Message requestMessage, Map<String,Object> properties) throws JMSExceptionSend an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... bytes.replyTo( message, [ 'property': 'value' ] )
- Parameters:
bytes- the array of bytes to sendrequestMessage- the message to reply toproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
replyWith
public static void replyWith(Message requestMessage, Serializable obj) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world' message.replyWith( serializable )
- Parameters:
requestMessage- the message to reply toobj- the object to send- Throws:
JMSException- Since:
- 1.0
-
replyWith
public static void replyWith(Message requestMessage, Serializable obj, Map<String,Object> properties) throws JMSException
Send a serializable object to the JMS broker.
Example usage:
Serializable serializable = 'Hello, world' message.replyWith( serializable, [ 'property' : 'value' ] )
- Parameters:
requestMessage- the message to reply toobj- the object to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException- Since:
- 1.0
-
replyWith
public static void replyWith(Message requestMessage, String string) throws JMSException
Send a string to the JMS broker.
Example usage:
message.replyWith( 'Hello, world' )
- Parameters:
requestMessage- the message to reply tostring- the string to send- Throws:
JMSException- Since:
- 1.0
-
replyWith
public static void replyWith(Message requestMessage, String string, Map<String,Object> properties) throws JMSException
Send a string to the JMS broker.
Example usage:
message.replyWith( 'Hello, world', [ 'property': 'value' ] )
- Parameters:
requestMessage- the message to reply tostring- the string to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException
-
replyWith
public static void replyWith(Message requestMessage, byte[] bytes) throws JMSException
Send an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... message.replyWith( bytes )
- Parameters:
requestMessage- the message to reply tobytes- the array of bytes to send- Throws:
JMSException- Since:
- 1.0
-
replyWith
public static void replyWith(Message requestMessage, byte[] bytes, Map<String,Object> properties) throws JMSException
Send an array of bytes to the JMS broker.
Example usage:
def bytes = new byte[]; ... message.replyWith( bytes, [ 'property': 'value' ] )
- Parameters:
requestMessage- the message to reply tobytes- the array of bytes to sendproperties- Map of properties to set on the message. Property values must be aStringor primitive. The producer options can also be configured with the following keys: persistentDelivery, timeToLive, priority, and ackMode.- Throws:
JMSException
-
sendAlert
public static void sendAlert(String message) throws JMSException
Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
'Hello, world'.sendAlert()
- Parameters:
message- alert message- Throws:
JMSException- Since:
- 1.0
-
sendAlert
public static void sendAlert(String message, int severity) throws JMSException
Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
'Hello, world'.sendAlert( 1 )
- Parameters:
message- alert messageseverity- severity of the alert- Throws:
JMSException- Since:
- 1.0
-
sendAlert
public static void sendAlert(String message, String source) throws JMSException
Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
'Hello, world'.sendAlert( 'source' )
- Parameters:
message- alert messagesource- the source of the alert- Throws:
JMSException- Since:
- 1.0
-
sendAlert
public static void sendAlert(String message, String source, int severity) throws JMSException
Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
'Hello, world'.sendAlert( 'source', 0 )
- Parameters:
message- alert messagesource- the source of the alertseverity- severity of the alert- Throws:
JMSException- Since:
- 1.0
-
sendAlert
public static void sendAlert(String message, String source, int severity, Map<Serializable,Serializable> properties) throws JMSException
Send a message with the provided properties to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
'Hello, world'.sendAlert( 'source', 0, [ 'property': 'value' ] )
- Parameters:
message- alert messagesource- the source of the alertseverity- severity of the alertproperties- properties of the alert- Throws:
JMSException- Since:
- 1.0
-
sendAlert
public static void sendAlert(AlertJMSMessage alertJMSMessage) throws JMSException
Send a message to the alert topic topic://io.toro.martini.alert.AlertQueue.
Example usage:
def message = new AlertJMSMessage( 'message', 'source', 0, [ 'property': 'value' ] ) message.sendAlert()
- Parameters:
alertJMSMessage- the message to be sent to JMS broker- Throws:
JMSException- Since:
- 1.0
-
-