Interface JmsMessage<PAYLOAD>
- Type Parameters:
PAYLOAD
- Type of the payload.
- All Superinterfaces:
Message<PAYLOAD>
- All Known Subinterfaces:
AqMessage<T>
- All Known Implementing Classes:
JmsBytesMessage
,JmsTextMessage
Message representing JMS message together with all the metadata.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Mapper for creatingMessage
.static class
Outgoing JMS message builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic <PAYLOAD> JmsMessage.OutgoingJmsMessageBuilder<PAYLOAD>
builder()
Outgoing JMS message builder.static <PAYLOAD> JmsMessage.OutgoingJmsMessageBuilder<PAYLOAD>
builder
(jakarta.jms.Message msg) Outgoing JMS message builder.static <PAYLOAD> JmsMessage.OutgoingJmsMessageBuilder<PAYLOAD>
builder
(PAYLOAD payload) Outgoing JMS message builder.default String
Return correlation id of the message.jakarta.jms.Connection
Get client's connection to its JMS provider.jakarta.jms.ConnectionFactory
Get JMS connection factory.<MSG extends jakarta.jms.Message>
MSGOriginal JMS message received.jakarta.jms.Session
Metadata about the JMS session.<P> P
getProperty
(String name) Get JMS property by name.Return set of all JMS property names.default jakarta.jms.Destination
Return reply to destination of the message.default String
getType()
Return type identifier set by sending JMS client.boolean
hasProperty
(String name) Check if JMS property exists.boolean
isAck()
Check if message has been acknowledged yet.static <PAYLOAD> Message<PAYLOAD>
of
(PAYLOAD payload) Create a JmsMessage with the given payload.static <PAYLOAD> Message<PAYLOAD>
of
(PAYLOAD payload, Supplier<CompletionStage<Void>> ack) Create a JmsMessage with the given payload and ack function.Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, getAck, getNack, getPayload, nack, unwrap, withAck, withNack, withPayload
-
Method Details
-
getJmsSession
jakarta.jms.Session getJmsSession()Metadata about the JMS session.- Returns:
- JMS session
-
getJmsConnection
jakarta.jms.Connection getJmsConnection()Get client's connection to its JMS provider.- Returns:
- JMS connection
-
getJmsConnectionFactory
jakarta.jms.ConnectionFactory getJmsConnectionFactory()Get JMS connection factory.- Returns:
- JMS connection factory
-
getJmsMessage
<MSG extends jakarta.jms.Message> MSG getJmsMessage()Original JMS message received.- Type Parameters:
MSG
- expected sub-type ofMessage
- Returns:
- original JMS message received
- Throws:
ClassCastException
- when original payload cannot be casted to expected type
-
getType
Return type identifier set by sending JMS client.- Returns:
- JMS type or null
-
getCorrelationId
Return correlation id of the message.- Returns:
- correlation id or null
-
getReplyTo
default jakarta.jms.Destination getReplyTo()Return reply to destination of the message.- Returns:
- destination or null
-
isAck
boolean isAck()Check if message has been acknowledged yet.- Returns:
- true if message has been acknowledged
-
getProperty
Get JMS property by name.- Type Parameters:
P
- expected type of the property, has to be Boolean, Byte, Short, Integer, Long, Float, Double or String- Parameters:
name
- the name of the JMS property- Returns:
- property value with the specified name or null
- Throws:
ClassCastException
- when property cannot be casted to expected type
-
hasProperty
Check if JMS property exists.- Parameters:
name
- the name of the JMS property- Returns:
- true if property exists
-
getPropertyNames
Return set of all JMS property names.- Returns:
- JMS property names
-
of
Create a JmsMessage with the given payload and ack function.- Type Parameters:
PAYLOAD
- the type of payload- Parameters:
payload
- The payload.ack
- The ack function, this will be invoked when the returned messagesMessage.ack()
method is invoked.- Returns:
- A message with the given payload and ack function.
-
of
Create a JmsMessage with the given payload.- Type Parameters:
PAYLOAD
- The type of payload- Parameters:
payload
- The payload.- Returns:
- A message with the given payload, and a no-op ack function.
-
builder
Outgoing JMS message builder. Makes possible to create JMS message with properties.- Type Parameters:
PAYLOAD
- JMS message payload type- Parameters:
payload
- JMS message payload- Returns:
- Message builder
-
builder
Outgoing JMS message builder. Makes possible to create JMS message fromMessage
and customize result. Does NOT copy payload, only headers and properties.- Type Parameters:
PAYLOAD
- payload type- Parameters:
msg
-Message
to derive metadata- Returns:
- Message builder
- Throws:
MessagingException
- when JMS provider can't retrieve message body, properties or metadata
-
builder
Outgoing JMS message builder. Makes possible to create JMS message with properties.- Type Parameters:
PAYLOAD
- JMS message payload type- Returns:
- Message builder
-