public final class JmsMethods extends Object
JMS Message
s.Modifier and Type | Method and Description |
---|---|
static void |
publishBytes(String destinationName,
byte[] bytes)
|
static void |
publishBytes(String destinationName,
byte[] bytes,
Closure replyClosure)
|
static void |
publishBytes(String destinationName,
byte[] bytes,
Map<String,Object> properties)
|
static void |
publishObject(String destinationName,
Serializable obj)
Sends a serializable object to the JMS broker.
|
static void |
publishObject(String destinationName,
Serializable obj,
Closure replyClosure)
Sends a serializable object to the JMS broker.
|
static void |
publishObject(String destinationName,
Serializable obj,
Map<String,Object> properties)
Sends a serializable object to the JMS broker.
|
static void |
publishString(String destinationName,
String string)
Send a string to the JMS broker.
|
static void |
publishString(String destinationName,
String string,
Closure replyClosure)
Send a string to the JMS broker.
|
static void |
publishString(String destinationName,
String string,
Map<String,Object> properties)
Send a string to the JMS broker.
|
static void |
publishTo(byte[] bytes,
String destinationName)
Send a byte array to the JMS broker.
|
static void |
publishTo(byte[] bytes,
String destinationName,
Closure replyClosure)
|
static void |
publishTo(byte[] bytes,
String destinationName,
Map properties)
Send a byte array to the JMS broker.
|
static void |
publishTo(Serializable obj,
String destinationName)
Sends a serializable object to the JMS broker.
|
static void |
publishTo(Serializable obj,
String destinationName,
Closure replyClosure)
Sends a serializable object to the JMS broker.
|
static void |
publishTo(Serializable obj,
String destinationName,
Map<String,Object> properties)
Sends a serializable object to the JMS broker.
|
static void |
publishTo(String string,
String destinationName)
Send a string to the JMS broker Example usage:
|
static void |
publishTo(String string,
String destinationName,
Closure replyClosure)
Send a string to the JMS broker.
|
static void |
publishTo(String string,
String destinationName,
Map properties)
Send a string to the JMS broker
|
static void |
replyTo(byte[] bytes,
Message requestMessage)
Send a byte array to the JMS broker.
|
static void |
replyTo(byte[] bytes,
Message requestMessage,
Map<String,Object> properties)
Send a byte array to the JMS broker.
|
static void |
replyTo(Serializable obj,
Message requestMessage)
Sends a serializable object to the JMS broker.
|
static void |
replyTo(Serializable obj,
Message requestMessage,
Map<String,Object> properties)
Sends a serializable object to the JMS broker.
|
static void |
replyTo(String string,
Message requestMessage)
Send a string to the JMS broker Example usage:
|
static void |
replyTo(String string,
Message requestMessage,
Map<String,Object> properties)
Send a string to the JMS broker
|
static void |
replyWith(Message requestMessage,
byte[] bytes)
|
static void |
replyWith(Message requestMessage,
byte[] bytes,
Map<String,Object> properties)
Send a byte array to the JMS broker.
|
static void |
replyWith(Message requestMessage,
Serializable obj)
Sends a serializable object to the JMS broker.
|
static void |
replyWith(Message requestMessage,
Serializable obj,
Map<String,Object> properties)
Sends a serializable object to the JMS broker.
|
static void |
replyWith(Message requestMessage,
String string)
Send a string to the JMS broker.
|
static void |
replyWith(Message requestMessage,
String string,
Map<String,Object> properties)
Send a string to the JMS broker.
|
static void |
sendAlert(AlertJMSMessage alertJMSMessage)
Sends an AlertJMSMessage object to JMS Topic 'topic://io.toro.martini.alert.AlertQueue'
Example usage:
|
static void |
sendAlert(String message)
|
static void |
sendAlert(String message,
int severity)
Sends an AlertJMSMessage object to JMS Topic 'topic://io.toro.martini.alert.AlertQueue'
Defaults for the AlertJMSMessage to be sent to JMS Broker:
Source : Martini Package name Properties : empty map Example usage: |
static void |
sendAlert(String message,
String source)
Sends an AlertJMSMessage object to JMS Topic 'topic://io.toro.martini.alert.AlertQueue'
Defaults for the AlertJMSMessage to be sent to JMS Broker:
Severity: 0 Properties : empty map Example usage: |
static void |
sendAlert(String message,
String source,
int severity)
Sends an AlertJMSMessage object to JMS Topic 'topic://io.toro.martini.alert.AlertQueue'
Defaults for the AlertJMSMessage to be sent to JMS Broker:
Properties : empty map |
static void |
sendAlert(String message,
String source,
int severity,
Map<Serializable,Serializable> properties)
Sends an AlertJMSMessage object to JMS Topic 'topic://io.toro.martini.alert.AlertQueue'
Example usage:
|
public static void publishTo(Serializable obj, String destinationName) throws JMSException
'hello world'.publishTo('queue://com.toro.hello.HelloQueue')
obj
- The object to senddestinationName
- The name of the queue/topic to send the object toJMSException
public static void publishTo(Serializable obj, String destinationName, Closure replyClosure) throws JMSException
'hello world'.publishTo('queue://com.toro.hello.HelloQueue'){ message -> println 'received a reply: ${message}' }
obj
- The object to senddestinationName
- The name of the queue/topic to send the object toJMSException
public static void publishTo(Serializable obj, String destinationName, Map<String,Object> properties) throws JMSException
'hello world'.publishTo('queue://com.toro.hello.HelloQueue', [ "some" : "property" ])
obj
- The object to senddestinationName
- The name of the queue/topic to send the object toproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void publishTo(String string, String destinationName) throws JMSException
def jmsMessage = 'helloworld'.publishTo('queue://com.toro.hello.HelloQueue')
string
- The string to senddestinationName
- The name of the queue/topic to send the object to JMSException
public static void publishTo(String string, String destinationName, Map properties) throws JMSException
string
- The string to senddestinationName
- The name of the queue/topic to send the object to properties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void publishTo(String string, String destinationName, Closure replyClosure) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishString('hello world'){ println 'received a reply: ${message}' }
destinationName
- The name of the queue/topic to send the object tostring
- The string to sendJMSException
public static void publishTo(byte[] bytes, String destinationName) throws JMSException
def bytes = new byte[]; ... bytes.publishTo('queue://com.toro.bytes.BytesQueue')
bytes
- The byte array to senddestinationName
- the name of the queue/topic to send the object toJMSException
public static void publishTo(byte[] bytes, String destinationName, Map properties) throws JMSException
def bytes = new byte[]; ... bytes.publishTo('queue://com.toro.bytes.BytesQueue')
bytes
- The byte array to senddestinationName
- the name of the queue/topic to send the object toproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void publishTo(byte[] bytes, String destinationName, Closure replyClosure) throws JMSException
def bytes = new byte[]; ... bytes.publishTo('queue://com.toro.bytes.BytesQueue'){ message -> println 'received a reply: ${message}" }
destinationName
- The name of the queue/topic to send the object tobytes
- The byte array to sendJMSException
public static void publishObject(String destinationName, Serializable obj, Map<String,Object> properties) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishObject('hello world', [ "some" : "property" ])
destinationName
- The name of the queue/topic to send the object toobj
- The object to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void publishObject(String destinationName, Serializable obj) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishObject('hello world')
destinationName
- The name of the queue/topic to send the object toobj
- The object to sendJMSException
public static void publishObject(String destinationName, Serializable obj, Closure replyClosure) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishObject('hello world'){ message -> println 'received a reply: ${message}" }
destinationName
- The name of the queue/topic to send the object toobj
- The object to sendJMSException
public static void publishString(String destinationName, String string) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishString('hello world')
destinationName
- The name of the queue/topic to send the object tostring
- The string to sendJMSException
public static void publishString(String destinationName, String string, Closure replyClosure) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishString('hello world'){ message -> println 'received a reply: ${message}' }
destinationName
- The name of the queue/topic to send the object tostring
- The string to sendJMSException
public static void publishString(String destinationName, String string, Map<String,Object> properties) throws JMSException
'queue://com.toro.hello.HelloQueue'.publishString('hello world', [ "some" : "property" ])
destinationName
- The name of the queue/topic to send the object tostring
- The string to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void publishBytes(String destinationName, byte[] bytes) throws JMSException
def bytes = new byte[]; ... 'queue://com.toro.bytes.BytesQueue'.publishBytes(bytes)
destinationName
- The name of the queue/topic to send the object tobytes
- The byte array to sendJMSException
public static void publishBytes(String destinationName, byte[] bytes, Closure replyClosure) throws JMSException
def bytes = new byte[]; ... 'queue://com.toro.bytes.BytesQueue'.publishBytes(bytes){ message -> println 'received a reply: ${message}' }
destinationName
- The name of the queue/topic to send the object tobytes
- The byte array to sendJMSException
public static void publishBytes(String destinationName, byte[] bytes, Map<String,Object> properties) throws JMSException
def bytes = new byte[]; ... 'queue://com.toro.bytes.BytesQueue'.publishBytes(bytes)
destinationName
- The name of the queue/topic to send the object tobytes
- The byte array to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void replyTo(Serializable obj, Message requestMessage) throws JMSException
'hello world'.replyTo( requestMessage )
obj
- The object to sendrequestMessage
- The message to reply to.JMSException
public static void replyTo(Serializable obj, Message requestMessage, Map<String,Object> properties) throws JMSException
'hello world'.replyTo( requestMessage, properties )
obj
- The object to sendrequestMessage
- The message to reply to.properties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void replyTo(String string, Message requestMessage) throws JMSException
'hello world'.publishTo('queue://com.toro.hello.HelloQueue')
string
- The string to sendrequestMessage
- The message to reply to.JMSException
public static void replyTo(String string, Message requestMessage, Map<String,Object> properties) throws JMSException
string
- The string to sendrequestMessage
- The message to reply to.properties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode' Example
usage:
JMSException
public static void replyTo(byte[] bytes, Message requestMessage) throws JMSException
def bytes = new byte[]; ... bytes.publishTo(myDestination)
bytes
- The byte array to sendrequestMessage
- The message to reply to.JMSException
public static void replyTo(byte[] bytes, Message requestMessage, Map<String,Object> properties) throws JMSException
def bytes = new byte[]; ... bytes.replyTo(myDestination)
bytes
- The byte array to sendrequestMessage
- The message to reply to.properties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void replyWith(Message requestMessage, Serializable obj) throws JMSException
message.replyWith('hello world')
requestMessage
- The message to reply to.obj
- The object to sendJMSException
public static void replyWith(Message requestMessage, Serializable obj, Map<String,Object> properties) throws JMSException
message.replyWith('hello world', [ "some" : "property" ])
requestMessage
- The message to reply to.obj
- The object to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void replyWith(Message requestMessage, String string) throws JMSException
message.replyWith('hello world')
requestMessage
- The message to reply to.string
- The string to sendJMSException
public static void replyWith(Message requestMessage, String string, Map<String,Object> properties) throws JMSException
message.replyWith('hello world')
requestMessage
- The message to reply to.string
- The string to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void replyWith(Message requestMessage, byte[] bytes) throws JMSException
def bytes = new byte[]; ... message.replyWith( bytes )
requestMessage
- The message to reply to.bytes
- The byte array to sendJMSException
public static void replyWith(Message requestMessage, byte[] bytes, Map<String,Object> properties) throws JMSException
def bytes = new byte[]; ... message.replyWith(bytes)
requestMessage
- The message to reply to.bytes
- The byte array to sendproperties
- Any properties to set on the message. Property values must be a string or primitive. The
producer options can also be configured with the following keys: 'persistentDelivery', 'timeToLive',
'priority',
'ackMode'JMSException
public static void sendAlert(String message) throws JMSException
'hello world'.sendAlert()
message
- alert messageJMSException
public static void sendAlert(String message, int severity) throws JMSException
'hello world'.sendAlert( 1 )
message
- alert messageJMSException
public static void sendAlert(String message, String source) throws JMSException
'hello world'.sendAlert('Martini Alert Package' )
message
- alert messagesource
- The source of the alertJMSException
public static void sendAlert(String message, String source, int severity) throws JMSException
'hello world'.sendAlert('Martini Alert Package', 0 )
message
- alert messagesource
- The source of the alertseverity
- Severity of the alertJMSException
public static void sendAlert(String message, String source, int severity, Map<Serializable,Serializable> properties) throws JMSException
'hello world'.sendAlert('Martini Alert Package', 0, [ 'data' : 'exampleData' ] )
message
- alert messagesource
- The source of the alertseverity
- Severity of the alertproperties
- properties of the alertJMSException
public static void sendAlert(AlertJMSMessage alertJMSMessage) throws JMSException
def alertJMSMessage = new AlertJMSMessage('My Message','Source',0,[ 'data' : 'exampleData' ] ) alertJMSMessage.sendAlert()
alertJMSMessage
- AlertJMSMessage object to be sent to JMS BrokerJMSException
Copyright © 2019. All rights reserved.