org.springframework.jms.support.QosSettings Java Examples
The following examples show how to use
org.springframework.jms.support.QosSettings.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MessagingMessageListenerAdapterTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void replyWithFullQoS() throws JMSException { Session session = mock(Session.class); Queue replyDestination = mock(Queue.class); given(session.createQueue("queueOut")).willReturn(replyDestination); MessageProducer messageProducer = mock(MessageProducer.class); TextMessage responseMessage = mock(TextMessage.class); given(session.createTextMessage("Response")).willReturn(responseMessage); given(session.createProducer(replyDestination)).willReturn(messageProducer); MessagingMessageListenerAdapter listener = getPayloadInstance("Response", "replyPayloadToQueue", Message.class); QosSettings settings = new QosSettings(DeliveryMode.NON_PERSISTENT, 6, 6000); listener.setResponseQosSettings(settings); listener.onMessage(mock(javax.jms.Message.class), session); verify(session).createQueue("queueOut"); verify(session).createTextMessage("Response"); verify(messageProducer).send(responseMessage, DeliveryMode.NON_PERSISTENT, 6, 6000); verify(messageProducer).close(); }
Example #2
Source File: QosSettingsFactory.java From c2mon with GNU Lesser General Public License v3.0 | 6 votes |
/** * We Take the first {@link SourceDataTagValue} object from collection to determine * the Quality-of-Service settings for the message sending * @param sourceDataTagValue the first tag extracted from {@link DataTagValueUpdate} * @return the Quality-of-Service settings for determine the {@link JmsTemplate} */ static QosSettings extractQosSettings(SourceDataTagValue sourceDataTagValue) { QosSettings settings = new QosSettings(); settings.setPriority(sourceDataTagValue.getPriority()); settings.setTimeToLive(sourceDataTagValue.getTimeToLive()); if (sourceDataTagValue.isGuaranteedDelivery()) { log.debug("\t sending PERSISTENT message"); settings.setDeliveryMode(DeliveryMode.PERSISTENT); } else { log.debug("\t sending NON-PERSISTENT message"); settings.setDeliveryMode(DeliveryMode.NON_PERSISTENT); } return settings; }
Example #3
Source File: AbstractAdaptableMessageListener.java From java-technology-stack with MIT License | 6 votes |
/** * Send the given response message to the given destination. * @param response the JMS message to send * @param destination the JMS destination to send to * @param session the JMS session to operate on * @throws JMSException if thrown by JMS API methods * @see #postProcessProducer * @see javax.jms.Session#createProducer * @see javax.jms.MessageProducer#send */ protected void sendResponse(Session session, Destination destination, Message response) throws JMSException { MessageProducer producer = session.createProducer(destination); try { postProcessProducer(producer, response); QosSettings settings = getResponseQosSettings(); if (settings != null) { producer.send(response, settings.getDeliveryMode(), settings.getPriority(), settings.getTimeToLive()); } else { producer.send(response); } } finally { JmsUtils.closeMessageProducer(producer); } }
Example #4
Source File: MessagingMessageListenerAdapterTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void replyWithFullQoS() throws JMSException { Session session = mock(Session.class); Queue replyDestination = mock(Queue.class); given(session.createQueue("queueOut")).willReturn(replyDestination); MessageProducer messageProducer = mock(MessageProducer.class); TextMessage responseMessage = mock(TextMessage.class); given(session.createTextMessage("Response")).willReturn(responseMessage); given(session.createProducer(replyDestination)).willReturn(messageProducer); MessagingMessageListenerAdapter listener = getPayloadInstance("Response", "replyPayloadToQueue", Message.class); QosSettings settings = new QosSettings(DeliveryMode.NON_PERSISTENT, 6, 6000); listener.setResponseQosSettings(settings); listener.onMessage(mock(javax.jms.Message.class), session); verify(session).createQueue("queueOut"); verify(session).createTextMessage("Response"); verify(messageProducer).send(responseMessage, DeliveryMode.NON_PERSISTENT, 6, 6000); verify(messageProducer).close(); }
Example #5
Source File: MessagingMessageListenerAdapterTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void replyWithCustomTimeToLive() throws JMSException { Session session = mock(Session.class); Queue replyDestination = mock(Queue.class); given(session.createQueue("queueOut")).willReturn(replyDestination); MessageProducer messageProducer = mock(MessageProducer.class); TextMessage responseMessage = mock(TextMessage.class); given(session.createTextMessage("Response")).willReturn(responseMessage); given(session.createProducer(replyDestination)).willReturn(messageProducer); MessagingMessageListenerAdapter listener = getPayloadInstance("Response", "replyPayloadToQueue", Message.class); QosSettings settings = new QosSettings(); settings.setTimeToLive(6000); listener.setResponseQosSettings(settings); listener.onMessage(mock(javax.jms.Message.class), session); verify(session).createQueue("queueOut"); verify(session).createTextMessage("Response"); verify(messageProducer).send(responseMessage, javax.jms.Message.DEFAULT_DELIVERY_MODE, javax.jms.Message.DEFAULT_PRIORITY, 6000); verify(messageProducer).close(); }
Example #6
Source File: MessagingMessageListenerAdapterTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void replyWithCustomTimeToLive() throws JMSException { Session session = mock(Session.class); Queue replyDestination = mock(Queue.class); given(session.createQueue("queueOut")).willReturn(replyDestination); MessageProducer messageProducer = mock(MessageProducer.class); TextMessage responseMessage = mock(TextMessage.class); given(session.createTextMessage("Response")).willReturn(responseMessage); given(session.createProducer(replyDestination)).willReturn(messageProducer); MessagingMessageListenerAdapter listener = getPayloadInstance("Response", "replyPayloadToQueue", Message.class); QosSettings settings = new QosSettings(); settings.setTimeToLive(6000); listener.setResponseQosSettings(settings); listener.onMessage(mock(javax.jms.Message.class), session); verify(session).createQueue("queueOut"); verify(session).createTextMessage("Response"); verify(messageProducer).send(responseMessage, javax.jms.Message.DEFAULT_DELIVERY_MODE, javax.jms.Message.DEFAULT_PRIORITY, 6000); verify(messageProducer).close(); }
Example #7
Source File: SynchroBufferFactory.java From c2mon with GNU Lesser General Public License v3.0 | 6 votes |
/** * Create new {@link SynchroBufferQueue} and start a new message dispatcher thread. * @param settings Quality-of-Service JMS settings */ private void createSynchroBufferQueue(QosSettings settings) { SynchroBufferQueue<SourceDataTagValue> buffer = new SynchroBufferQueue<>(); synchroBufferMap.put(settings, buffer); String name = "LOW-MSG-BUFFER-"; long timeout = daqProperties.getJms().getMaxMessageDelayPriorityLow(); switch (settings.getPriority()) { case DataTagConstants.PRIORITY_HIGH: timeout = daqProperties.getJms().getMaxMessageDelayPriorityHigh(); name = "HIGH-MSG-BUFFER-"; break; case DataTagConstants.PRIORITY_MEDIUM: timeout = daqProperties.getJms().getMaxMessageDelayPriorityMedium(); name = "MEDIUM-MSG-BUFFER-"; break; case DataTagConstants.PRIORITY_LOW: timeout = daqProperties.getJms().getMaxMessageDelayPriorityLow(); name = "LOW-MSG-BUFFER-"; break; default: log.warn("Got unsupported JMS priority: {}. Please check the DAQ configuration. Will use PRIORITY_LOW", settings.getPriority()); break; } startMessageConsumer(name + settings.getTimeToLive(), buffer, timeout); }
Example #8
Source File: AbstractAdaptableMessageListener.java From spring-analysis-note with MIT License | 6 votes |
/** * Send the given response message to the given destination. * @param response the JMS message to send * @param destination the JMS destination to send to * @param session the JMS session to operate on * @throws JMSException if thrown by JMS API methods * @see #postProcessProducer * @see javax.jms.Session#createProducer * @see javax.jms.MessageProducer#send */ protected void sendResponse(Session session, Destination destination, Message response) throws JMSException { MessageProducer producer = session.createProducer(destination); try { postProcessProducer(producer, response); QosSettings settings = getResponseQosSettings(); if (settings != null) { producer.send(response, settings.getDeliveryMode(), settings.getPriority(), settings.getTimeToLive()); } else { producer.send(response); } } finally { JmsUtils.closeMessageProducer(producer); } }
Example #9
Source File: JmsListenerContainerFactoryTests.java From java-technology-stack with MIT License | 5 votes |
private void setDefaultJcaConfig(DefaultJcaListenerContainerFactory factory) { factory.setDestinationResolver(this.destinationResolver); factory.setTransactionManager(this.transactionManager); factory.setMessageConverter(this.messageConverter); factory.setAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE); factory.setPubSubDomain(true); factory.setReplyQosSettings(new QosSettings(1, 7, 5000)); factory.setSubscriptionDurable(true); factory.setClientId("client-1234"); }
Example #10
Source File: JmsListenerContainerFactoryTests.java From java-technology-stack with MIT License | 5 votes |
private void assertDefaultJmsConfig(AbstractMessageListenerContainer container) { assertEquals(this.connectionFactory, container.getConnectionFactory()); assertEquals(this.destinationResolver, container.getDestinationResolver()); assertEquals(this.messageConverter, container.getMessageConverter()); assertEquals(true, container.isSessionTransacted()); assertEquals(Session.DUPS_OK_ACKNOWLEDGE, container.getSessionAcknowledgeMode()); assertEquals(true, container.isPubSubDomain()); assertEquals(true, container.isReplyPubSubDomain()); assertEquals(new QosSettings(1, 7, 5000), container.getReplyQosSettings()); assertEquals(true, container.isSubscriptionDurable()); assertEquals("client-1234", container.getClientId()); assertEquals(false, container.isAutoStartup()); }
Example #11
Source File: JmsListenerContainerFactoryTests.java From java-technology-stack with MIT License | 5 votes |
private void setDefaultJmsConfig(AbstractJmsListenerContainerFactory<?> factory) { factory.setConnectionFactory(this.connectionFactory); factory.setDestinationResolver(this.destinationResolver); factory.setMessageConverter(this.messageConverter); factory.setSessionTransacted(true); factory.setSessionAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE); factory.setPubSubDomain(true); factory.setReplyPubSubDomain(true); factory.setReplyQosSettings(new QosSettings(1, 7, 5000)); factory.setSubscriptionDurable(true); factory.setClientId("client-1234"); factory.setAutoStartup(false); }
Example #12
Source File: JmsMessageEndpointManagerTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void customReplyQosSettings() { JmsMessageEndpointManager endpoint = new JmsMessageEndpointManager(); JmsActivationSpecConfig config = new JmsActivationSpecConfig(); QosSettings settings = new QosSettings(1, 3, 5); config.setReplyQosSettings(settings); endpoint.setActivationSpecConfig(config); assertNotNull(endpoint.getReplyQosSettings()); assertEquals(1, endpoint.getReplyQosSettings().getDeliveryMode()); assertEquals(3, endpoint.getReplyQosSettings().getPriority()); assertEquals(5, endpoint.getReplyQosSettings().getTimeToLive()); }
Example #13
Source File: ProcessMessageSender.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
@Override public final void addValue(final SourceDataTagValue dataTagValue) throws InterruptedException { if (dataTagValue.getPriority() == DataTagConstants.PRIORITY_HIGHEST) { distributeValue(dataTagValue); } else { QosSettings settings = QosSettingsFactory.extractQosSettings(dataTagValue); synchroBufferFactory.getSynchroBuffer(settings).put(dataTagValue); } }
Example #14
Source File: JmsListenerContainerFactoryTests.java From java-technology-stack with MIT License | 5 votes |
private void assertDefaultJcaConfig(JmsMessageEndpointManager container) { assertEquals(this.messageConverter, container.getMessageConverter()); assertEquals(this.destinationResolver, container.getDestinationResolver()); JmsActivationSpecConfig config = container.getActivationSpecConfig(); assertNotNull(config); assertEquals(Session.DUPS_OK_ACKNOWLEDGE, config.getAcknowledgeMode()); assertEquals(true, config.isPubSubDomain()); assertEquals(new QosSettings(1, 7, 5000), container.getReplyQosSettings()); assertEquals(true, config.isSubscriptionDurable()); assertEquals("client-1234", config.getClientId()); }
Example #15
Source File: MethodJmsListenerEndpointTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void processAndReplyWithCustomReplyQosSettings() throws JMSException { String methodName = "processAndReplyWithSendTo"; SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); QosSettings replyQosSettings = new QosSettings(1, 6, 6000); container.setReplyQosSettings(replyQosSettings); MessagingMessageListenerAdapter listener = createInstance(this.factory, getListenerMethod(methodName, String.class), container); processAndReplyWithSendTo(listener, "replyDestination", false, replyQosSettings); assertListenerMethodInvocation(this.sample, methodName); }
Example #16
Source File: MethodJmsListenerEndpoint.java From java-technology-stack with MIT License | 5 votes |
@Override protected MessagingMessageListenerAdapter createMessageListener(MessageListenerContainer container) { Assert.state(this.messageHandlerMethodFactory != null, "Could not create message listener - MessageHandlerMethodFactory not set"); MessagingMessageListenerAdapter messageListener = createMessageListenerInstance(); InvocableHandlerMethod invocableHandlerMethod = this.messageHandlerMethodFactory.createInvocableHandlerMethod(getBean(), getMethod()); messageListener.setHandlerMethod(invocableHandlerMethod); String responseDestination = getDefaultResponseDestination(); if (StringUtils.hasText(responseDestination)) { if (container.isReplyPubSubDomain()) { messageListener.setDefaultResponseTopicName(responseDestination); } else { messageListener.setDefaultResponseQueueName(responseDestination); } } QosSettings responseQosSettings = container.getReplyQosSettings(); if (responseQosSettings != null) { messageListener.setResponseQosSettings(responseQosSettings); } MessageConverter messageConverter = container.getMessageConverter(); if (messageConverter != null) { messageListener.setMessageConverter(messageConverter); } DestinationResolver destinationResolver = container.getDestinationResolver(); if (destinationResolver != null) { messageListener.setDestinationResolver(destinationResolver); } return messageListener; }
Example #17
Source File: JmsMessageEndpointManager.java From java-technology-stack with MIT License | 5 votes |
@Override @Nullable public QosSettings getReplyQosSettings() { JmsActivationSpecConfig config = getActivationSpecConfig(); if (config != null) { return config.getReplyQosSettings(); } throw new IllegalStateException("Could not determine reply qosSettings - no activation spec config is set"); }
Example #18
Source File: JmsUpdateQueueTemplateFactory.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
/** * Creates for the given settings the JMSTemplate instance, if not yet done. * @param settings The Quality-of-Service settings to use * @return the dedicated {@link JmsTemplate} for the given settings */ public synchronized JmsTemplate getDataTagValueUpdateJmsTemplate(QosSettings settings) { if (!jmsTemplateMap.containsKey(settings)) { createDataTagValueUpdateJmsTemplate(settings); } return jmsTemplateMap.get(settings); }
Example #19
Source File: JmsUpdateQueueTemplateFactory.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
/** * Note, that the {@link JmsTemplate#setQosSettings(QosSettings)} is implicitly calling * {@link JmsTemplate#setExplicitQosEnabled(boolean)} * @param settings the Quality of Service settings for the template */ private void createDataTagValueUpdateJmsTemplate(QosSettings settings) { JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory); jmsTemplate.setDefaultDestination(destination); jmsTemplate.setQosSettings(settings); jmsTemplate.setMessageConverter(new DataTagValueUpdateConverter()); jmsTemplateMap.put(settings, jmsTemplate); }
Example #20
Source File: ActiveJmsSender.java From c2mon with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void publish(DataTagValueUpdate dataTagValueUpdate) { SourceDataTagValue sdtValue = dataTagValueUpdate.getValues().iterator().next(); QosSettings settings = QosSettingsFactory.extractQosSettings(sdtValue); // convert and send the collection of updates jmsUpdateQueueTemplateFactory.getDataTagValueUpdateJmsTemplate(settings).convertAndSend(dataTagValueUpdate); }
Example #21
Source File: MethodJmsListenerEndpointTests.java From java-technology-stack with MIT License | 5 votes |
private void processAndReplyWithSendTo(MessagingMessageListenerAdapter listener, String replyDestinationName, boolean pubSubDomain, QosSettings replyQosSettings) throws JMSException { String body = "echo text"; String correlationId = "link-1234"; Destination replyDestination = new Destination() {}; DestinationResolver destinationResolver = mock(DestinationResolver.class); TextMessage reply = mock(TextMessage.class); QueueSender queueSender = mock(QueueSender.class); Session session = mock(Session.class); given(destinationResolver.resolveDestinationName(session, replyDestinationName, pubSubDomain)) .willReturn(replyDestination); given(session.createTextMessage(body)).willReturn(reply); given(session.createProducer(replyDestination)).willReturn(queueSender); listener.setDestinationResolver(destinationResolver); StubTextMessage inputMessage = createSimpleJmsTextMessage(body); inputMessage.setJMSCorrelationID(correlationId); listener.onMessage(inputMessage, session); verify(destinationResolver).resolveDestinationName(session, replyDestinationName, pubSubDomain); verify(reply).setJMSCorrelationID(correlationId); if (replyQosSettings != null) { verify(queueSender).send(reply, replyQosSettings.getDeliveryMode(), replyQosSettings.getPriority(), replyQosSettings.getTimeToLive()); } else { verify(queueSender).send(reply); } verify(queueSender).close(); }
Example #22
Source File: MethodJmsListenerEndpointTests.java From spring-analysis-note with MIT License | 5 votes |
private void processAndReplyWithSendTo(MessagingMessageListenerAdapter listener, String replyDestinationName, boolean pubSubDomain, QosSettings replyQosSettings) throws JMSException { String body = "echo text"; String correlationId = "link-1234"; Destination replyDestination = new Destination() {}; DestinationResolver destinationResolver = mock(DestinationResolver.class); TextMessage reply = mock(TextMessage.class); QueueSender queueSender = mock(QueueSender.class); Session session = mock(Session.class); given(destinationResolver.resolveDestinationName(session, replyDestinationName, pubSubDomain)) .willReturn(replyDestination); given(session.createTextMessage(body)).willReturn(reply); given(session.createProducer(replyDestination)).willReturn(queueSender); listener.setDestinationResolver(destinationResolver); StubTextMessage inputMessage = createSimpleJmsTextMessage(body); inputMessage.setJMSCorrelationID(correlationId); listener.onMessage(inputMessage, session); verify(destinationResolver).resolveDestinationName(session, replyDestinationName, pubSubDomain); verify(reply).setJMSCorrelationID(correlationId); if (replyQosSettings != null) { verify(queueSender).send(reply, replyQosSettings.getDeliveryMode(), replyQosSettings.getPriority(), replyQosSettings.getTimeToLive()); } else { verify(queueSender).send(reply); } verify(queueSender).close(); }
Example #23
Source File: JmsMessageEndpointManager.java From spring-analysis-note with MIT License | 5 votes |
@Override @Nullable public QosSettings getReplyQosSettings() { JmsActivationSpecConfig config = getActivationSpecConfig(); if (config != null) { return config.getReplyQosSettings(); } throw new IllegalStateException("Could not determine reply qosSettings - no activation spec config is set"); }
Example #24
Source File: MethodJmsListenerEndpoint.java From spring-analysis-note with MIT License | 5 votes |
@Override protected MessagingMessageListenerAdapter createMessageListener(MessageListenerContainer container) { Assert.state(this.messageHandlerMethodFactory != null, "Could not create message listener - MessageHandlerMethodFactory not set"); MessagingMessageListenerAdapter messageListener = createMessageListenerInstance(); Object bean = getBean(); Method method = getMethod(); Assert.state(bean != null && method != null, "No bean+method set on endpoint"); InvocableHandlerMethod invocableHandlerMethod = this.messageHandlerMethodFactory.createInvocableHandlerMethod(bean, method); messageListener.setHandlerMethod(invocableHandlerMethod); String responseDestination = getDefaultResponseDestination(); if (StringUtils.hasText(responseDestination)) { if (container.isReplyPubSubDomain()) { messageListener.setDefaultResponseTopicName(responseDestination); } else { messageListener.setDefaultResponseQueueName(responseDestination); } } QosSettings responseQosSettings = container.getReplyQosSettings(); if (responseQosSettings != null) { messageListener.setResponseQosSettings(responseQosSettings); } MessageConverter messageConverter = container.getMessageConverter(); if (messageConverter != null) { messageListener.setMessageConverter(messageConverter); } DestinationResolver destinationResolver = container.getDestinationResolver(); if (destinationResolver != null) { messageListener.setDestinationResolver(destinationResolver); } return messageListener; }
Example #25
Source File: JmsMessageEndpointManagerTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void customReplyQosSettings() { JmsMessageEndpointManager endpoint = new JmsMessageEndpointManager(); JmsActivationSpecConfig config = new JmsActivationSpecConfig(); QosSettings settings = new QosSettings(1, 3, 5); config.setReplyQosSettings(settings); endpoint.setActivationSpecConfig(config); assertNotNull(endpoint.getReplyQosSettings()); assertEquals(1, endpoint.getReplyQosSettings().getDeliveryMode()); assertEquals(3, endpoint.getReplyQosSettings().getPriority()); assertEquals(5, endpoint.getReplyQosSettings().getTimeToLive()); }
Example #26
Source File: JmsListenerContainerFactoryTests.java From spring-analysis-note with MIT License | 5 votes |
private void setDefaultJmsConfig(AbstractJmsListenerContainerFactory<?> factory) { factory.setConnectionFactory(this.connectionFactory); factory.setDestinationResolver(this.destinationResolver); factory.setMessageConverter(this.messageConverter); factory.setSessionTransacted(true); factory.setSessionAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE); factory.setPubSubDomain(true); factory.setReplyPubSubDomain(true); factory.setReplyQosSettings(new QosSettings(1, 7, 5000)); factory.setSubscriptionDurable(true); factory.setClientId("client-1234"); factory.setAutoStartup(false); }
Example #27
Source File: JmsListenerContainerFactoryTests.java From spring-analysis-note with MIT License | 5 votes |
private void assertDefaultJmsConfig(AbstractMessageListenerContainer container) { assertEquals(this.connectionFactory, container.getConnectionFactory()); assertEquals(this.destinationResolver, container.getDestinationResolver()); assertEquals(this.messageConverter, container.getMessageConverter()); assertEquals(true, container.isSessionTransacted()); assertEquals(Session.DUPS_OK_ACKNOWLEDGE, container.getSessionAcknowledgeMode()); assertEquals(true, container.isPubSubDomain()); assertEquals(true, container.isReplyPubSubDomain()); assertEquals(new QosSettings(1, 7, 5000), container.getReplyQosSettings()); assertEquals(true, container.isSubscriptionDurable()); assertEquals("client-1234", container.getClientId()); assertEquals(false, container.isAutoStartup()); }
Example #28
Source File: JmsListenerContainerFactoryTests.java From spring-analysis-note with MIT License | 5 votes |
private void setDefaultJcaConfig(DefaultJcaListenerContainerFactory factory) { factory.setDestinationResolver(this.destinationResolver); factory.setTransactionManager(this.transactionManager); factory.setMessageConverter(this.messageConverter); factory.setAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE); factory.setPubSubDomain(true); factory.setReplyQosSettings(new QosSettings(1, 7, 5000)); factory.setSubscriptionDurable(true); factory.setClientId("client-1234"); }
Example #29
Source File: MethodJmsListenerEndpointTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void processAndReplyWithCustomReplyQosSettings() throws JMSException { String methodName = "processAndReplyWithSendTo"; SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); QosSettings replyQosSettings = new QosSettings(1, 6, 6000); container.setReplyQosSettings(replyQosSettings); MessagingMessageListenerAdapter listener = createInstance(this.factory, getListenerMethod(methodName, String.class), container); processAndReplyWithSendTo(listener, "replyDestination", false, replyQosSettings); assertListenerMethodInvocation(this.sample, methodName); }
Example #30
Source File: JmsListenerContainerFactoryTests.java From spring-analysis-note with MIT License | 5 votes |
private void assertDefaultJcaConfig(JmsMessageEndpointManager container) { assertEquals(this.messageConverter, container.getMessageConverter()); assertEquals(this.destinationResolver, container.getDestinationResolver()); JmsActivationSpecConfig config = container.getActivationSpecConfig(); assertNotNull(config); assertEquals(Session.DUPS_OK_ACKNOWLEDGE, config.getAcknowledgeMode()); assertEquals(true, config.isPubSubDomain()); assertEquals(new QosSettings(1, 7, 5000), container.getReplyQosSettings()); assertEquals(true, config.isSubscriptionDurable()); assertEquals("client-1234", config.getClientId()); }