use of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method processAndReplyWithSendToTopic.
@Test
public void processAndReplyWithSendToTopic() throws JMSException {
String methodName = "processAndReplyWithSendTo";
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setPubSubDomain(true);
MessagingMessageListenerAdapter listener = createInstance(this.factory, getListenerMethod(methodName, String.class), container);
processAndReplyWithSendTo(listener, "replyDestination", true);
assertListenerMethodInvocation(sample, methodName);
}
use of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method resolveHeaders.
@Test
public void resolveHeaders() throws JMSException {
MessagingMessageListenerAdapter listener = createDefaultInstance(String.class, Map.class);
Session session = mock(Session.class);
StubTextMessage message = createSimpleJmsTextMessage("my payload");
message.setIntProperty("customInt", 1234);
message.setJMSMessageID("abcd-1234");
listener.onMessage(message, session);
assertDefaultListenerMethodInvocation();
}
use of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method resolveJmsMessageHeaderAccessor.
@Test
public void resolveJmsMessageHeaderAccessor() throws JMSException {
MessagingMessageListenerAdapter listener = createDefaultInstance(JmsMessageHeaderAccessor.class);
Session session = mock(Session.class);
StubTextMessage message = createSimpleJmsTextMessage("my payload");
message.setBooleanProperty("customBoolean", true);
message.setJMSPriority(9);
listener.onMessage(message, session);
assertDefaultListenerMethodInvocation();
}
use of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method processAndReplyWithSendToQueue.
@Test
public void processAndReplyWithSendToQueue() throws JMSException {
String methodName = "processAndReplyWithSendTo";
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
MessagingMessageListenerAdapter listener = createInstance(this.factory, getListenerMethod(methodName, String.class), container);
processAndReplyWithSendTo(listener, "replyDestination", false);
assertListenerMethodInvocation(sample, methodName);
}
use of org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter in project spring-framework by spring-projects.
the class MethodJmsListenerEndpointTests method resolveCustomHeaderNameAndPayloadWithHeaderNameSet.
@Test
public void resolveCustomHeaderNameAndPayloadWithHeaderNameSet() throws JMSException {
MessagingMessageListenerAdapter listener = createDefaultInstance(String.class, int.class);
Session session = mock(Session.class);
StubTextMessage message = createSimpleJmsTextMessage("my payload");
message.setIntProperty("myCounter", 24);
listener.onMessage(message, session);
assertDefaultListenerMethodInvocation();
}
Aggregations