Interface JmsClient.OperationSpec
- Enclosing interface:
JmsClient
public static interface JmsClient.OperationSpec
Common JMS send and receive operations with various settings.
- Since:
- 7.0
- Author:
- Juergen Hoeller, Brian Clozel
-
Method Summary
Modifier and TypeMethodDescriptionreceive()Receive aMessagefrom the pre-bound destination.<T> Optional<T> Receive aMessagefrom the pre-bound destination, extracting and converting its payload.Receive aMessagefrom the pre-bound destination.<T> Optional<T> Receive aMessagefrom the pre-bound destination, extracting and converting its payload.voidSend a message with the given payload to the pre-bound destination.voidSend a message with the given payload to the pre-bound destination.voidSend the givenMessageto the pre-bound destination.<T> Optional<T> sendAndReceive(Object request, Class<T> targetClass) Send a request message and receive the reply from the given destination.<T> Optional<T> Send a request message and receive the reply from the given destination.sendAndReceive(Message<?> requestMessage) Send a request message and receive the reply from the given destination.withDeliveryDelay(long deliveryDelay) Apply the given delivery delay to any subsequent send operations.withDeliveryPersistent(boolean persistent) Set whether message delivery should be persistent or non-persistent.withPriority(int priority) Apply the given priority to any subsequent send operations.withReceiveTimeout(long receiveTimeout) Apply the given timeout to any subsequent receive operations.withTimeToLive(long timeToLive) Apply the given time-to-live to any subsequent send operations.
-
Method Details
-
withReceiveTimeout
Apply the given timeout to any subsequent receive operations.- Parameters:
receiveTimeout- the timeout in milliseconds- See Also:
-
withDeliveryDelay
Apply the given delivery delay to any subsequent send operations.- Parameters:
deliveryDelay- the delay in milliseconds- See Also:
-
withDeliveryPersistent
Set whether message delivery should be persistent or non-persistent.- Parameters:
persistent- to choose between delivery mode "PERSISTENT" (true) or "NON_PERSISTENT" (false)- See Also:
-
withPriority
Apply the given priority to any subsequent send operations.- Parameters:
priority- the priority value- See Also:
-
withTimeToLive
Apply the given time-to-live to any subsequent send operations.- Parameters:
timeToLive- the message lifetime in milliseconds- See Also:
-
send
Send the givenMessageto the pre-bound destination.- Parameters:
message- the spring-messagingMessageto send- Throws:
MessagingException- See Also:
-
send
Send a message with the given payload to the pre-bound destination.- Parameters:
payload- the payload to convert into aMessage- Throws:
MessagingException- See Also:
-
send
Send a message with the given payload to the pre-bound destination.- Parameters:
payload- the payload to convert into aMessageheaders- the message headers to apply to theMessage- Throws:
MessagingException- See Also:
-
receive
Receive aMessagefrom the pre-bound destination.- Returns:
- the spring-messaging
Messagereceived, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
receive
Receive aMessagefrom the pre-bound destination, extracting and converting its payload.- Parameters:
targetClass- the class to convert the payload to- Returns:
- the payload of the
Messagereceived, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
receive
Receive aMessagefrom the pre-bound destination.- Parameters:
messageSelector- the JMS message selector to apply- Returns:
- the spring-messaging
Messagereceived, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
receive
Receive aMessagefrom the pre-bound destination, extracting and converting its payload.- Parameters:
messageSelector- the JMS message selector to applytargetClass- the class to convert the payload to- Returns:
- the payload of the
Messagereceived, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
sendAndReceive
Send a request message and receive the reply from the given destination.- Parameters:
requestMessage- the spring-messagingMessageto send- Returns:
- the spring-messaging
Messagereceived as a reply, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
sendAndReceive
Send a request message and receive the reply from the given destination.- Parameters:
request- the payload to convert into a requestMessagetargetClass- the class to convert the reply's payload to- Returns:
- the payload of the
Messagereceived as a reply, orOptional.empty()if none - Throws:
MessagingException- See Also:
-
sendAndReceive
<T> Optional<T> sendAndReceive(Object request, Map<String, Object> headers, Class<T> targetClass) throws MessagingExceptionSend a request message and receive the reply from the given destination.- Parameters:
request- the payload to convert into a requestMessageheaders- the message headers to apply to the requestMessagetargetClass- the class to convert the reply's payload to- Returns:
- the payload of the
Messagereceived as a reply, orOptional.empty()if none - Throws:
MessagingException- See Also:
-