Customize QosSettings for JMS replies

This commit introduces QosSettings that gather the Qualify of Service
settings one can use when sending a message. Such object can now be
associated to any JMS endpoint that allows to send a reply as part of
the processing of an incoming message.

Issue: SPR-15408
This commit is contained in:
Stephane Nicoll
2017-04-18 13:15:18 +02:00
parent a49a0007b2
commit 1c0b3be6e6
14 changed files with 379 additions and 13 deletions

View File

@@ -2793,6 +2793,29 @@ example can be rewritten as follows:
}
----
Finally if you need to specify some QoS values for the response such as the priority or
the time to live, you can configure the `JmsListenerContainerFactory` accordingly:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
@Configuration
@EnableJms
public class AppConfig {
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory =
new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory());
QosSettings replyQosSettings = new ReplyQosSettings();
replyQosSettings.setPriority(2);
replyQosSettings.setTimeToLive(10000);
factory.setReplyQosSettings(replyQosSettings);
return factory;
}
}
----
[[jms-namespace]]