class: ActiveMqSession
[30:14] (extern: com.lehman.aussom.ActiveMqSession) extends: object
A JMS session created from ActiveMqConnection.createSession(). Destinations, producers, consumers, browsers, and messages are all created here, and transactions commit or roll back here. Use one session per thread, per the JMS contract.
Methods
-
createQueue (
string Name)Gets a queue destination. ActiveMQ wildcard names (orders.>) and composite names (a,b) are plain strings and work unchanged.
- @p
Nameis a string with the queue name. - @r
Anew ActiveMqDestination object.
- @p
-
createTopic (
string Name)Gets a topic destination.
- @p
Nameis a string with the topic name. - @r
Anew ActiveMqDestination object.
- @p
-
createTemporaryQueue ()
Creates a temporary queue that lives as long as the connection. Useful as a private reply destination for request/reply.
- @r
Anew ActiveMqDestination object.
- @r
-
createTemporaryTopic ()
Creates a temporary topic that lives as long as the connection.
- @r
Anew ActiveMqDestination object.
- @r
-
createProducer (
object Dest = null)Creates a producer. With a destination the producer's send() targets it; with null the producer is anonymous and sendTo() picks the destination per message.
- @p
Destis an ActiveMqDestination object or null (default null). - @r
Anew ActiveMqProducer object.
- @p
-
createConsumer (
object Dest, string Selector = null, bool NoLocal = false)Creates a consumer on a destination.
- @p
Destis an ActiveMqDestination object. - @p
Selectoris a string with a JMS selector, or null (default null). - @p
NoLocalis a bool that skips messages sent on this connection - topics only (default false). - @r
Anew ActiveMqConsumer object.
- @p
-
createDurableSubscriber (
object Topic, string SubName, string Selector = null, bool NoLocal = false)Creates a durable topic subscription. The connection needs a client ID (setClientId) set before connect(). Messages published while the subscriber is offline wait for it.
- @p
Topicis an ActiveMqDestination topic object. - @p
SubNameis a string with the subscription name. - @p
Selectoris a string with a JMS selector, or null (default null). - @p
NoLocalis a bool that skips messages sent on this connection (default false). - @r
Anew ActiveMqConsumer object.
- @p
-
unsubscribe (
string SubName)Removes a durable subscription by name. Close its consumer first.
- @p
SubNameis a string with the subscription name. - @r
thisobject
- @p
-
createBrowser (
object Queue, string Selector = null)Creates a browser that walks a snapshot of a queue without consuming its messages.
- @p
Queueis an ActiveMqDestination queue object. - @p
Selectoris a string with a JMS selector, or null (default null). - @r
Anew ActiveMqBrowser object.
- @p
-
createTextMessage (
string Text = null)Creates a text message.
- @p
Textis a string with the initial body, or null (default null). - @r
Anew ActiveMqMessage object.
- @p
-
createBytesMessage ()
Creates an empty bytes message. Fill it with writeBytes().
- @r
Anew ActiveMqMessage object.
- @r
-
createMapMessage ()
Creates an empty map message. Fill it with setMapValue().
- @r
Anew ActiveMqMessage object.
- @r
-
createStreamMessage ()
Creates an empty stream message. Fill it with writeValue().
- @r
Anew ActiveMqMessage object.
- @r
-
createObjectMessage ()
Creates an object message. Set the payload with setObject(). Reading the payload back requires trusted packages on the connection.
- @r
Anew ActiveMqMessage object.
- @r
-
createMessage ()
Creates a body-less message carrying only headers and properties.
- @r
Anew ActiveMqMessage object.
- @r
-
commit ()
Commits all sends and receives since the last commit on a transacted session.
- @r
thisobject
- @r
-
rollback ()
Rolls back all sends and receives since the last commit on a transacted session. Received messages are redelivered.
- @r
thisobject
- @r
-
recover ()
Redelivers messages received but not yet acknowledged on a client or individual acknowledge session.
- @r
thisobject
- @r
-
getTransacted ()
Reports whether this session is transacted.
- @r
Abool with true for a transacted session.
- @r
-
getAckMode ()
Gets this session's acknowledge mode.
- @r
Astring with auto, client, dups_ok, individual, or transacted.
- @r
-
close ()
Closes the session and everything created from it. Safe to call more than once.
- @r
thisobject
- @r