public NmsMessageDrivenEndpoint(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener)
 {
     AssertUtils.ArgumentNotNull(listenerContainer, "listener container must not be null");
     AssertUtils.ArgumentNotNull(listener, "listener must not be null");
     listenerContainer.MessageListener = listener;
     this.listenerContainer            = listenerContainer;
     this.listener = listener;
 }
 public NmsMessageDrivenEndpoint(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener)
 {
     AssertUtils.ArgumentNotNull(listenerContainer, "listener container must not be null");
     AssertUtils.ArgumentNotNull(listener, "listener must not be null");
     listenerContainer.MessageListener = listener;
     this.listenerContainer = listenerContainer;
     this.listener = listener;
 }
 public void DefaultHeaderMappingMessageConverter()
 {
     ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();
     listener.AfterPropertiesSet();
     HeaderMappingMessageConverter hmmc = GetHmmc(listener);
     Assert.That(hmmc, Is.Not.Null);
     SimpleMessageConverter smc = hmmc.GetType().GetField("converter", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(hmmc) as
                                  SimpleMessageConverter;
     Assert.That(smc, Is.Not.Null);
 }
 public void NoReplyToAndNoDefault()
 {
     QueueChannel requestChannel = new QueueChannel();
     StartBackgroundReplier(requestChannel);
     ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();
     listener.ExpectReply = true;
     listener.RequestChannel = requestChannel;
     listener.MessageConverter = new TestMessageConverter();
     Apache.NMS.IMessage nmsMessage = session.CreateTextMessage("test");
     listener.AfterPropertiesSet();
     listener.OnMessage(nmsMessage, session);
 }
        public void CustomMessageConverterDecoratedForHeaderMapping()
        {
            ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();
            IMessageConverter originalConverter = new TestMessageConverter();
            listener.MessageConverter = originalConverter;
            listener.AfterPropertiesSet();
            HeaderMappingMessageConverter hmmc = GetHmmc(listener);
            Assert.That(hmmc, Is.Not.Null);

            TestMessageConverter smc = hmmc.GetType().GetField("converter", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(hmmc) as
                                       TestMessageConverter;
            Assert.That(smc, Is.Not.Null);
        }
        public void DefaultHeaderMappingMessageConverter()
        {
            ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();

            listener.AfterPropertiesSet();
            HeaderMappingMessageConverter hmmc = GetHmmc(listener);

            Assert.That(hmmc, Is.Not.Null);
            SimpleMessageConverter smc = hmmc.GetType().GetField("converter", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(hmmc) as
                                         SimpleMessageConverter;

            Assert.That(smc, Is.Not.Null);
        }
        public void NoReplyToAndNoDefault()
        {
            QueueChannel requestChannel = new QueueChannel();

            StartBackgroundReplier(requestChannel);
            ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();

            listener.ExpectReply      = true;
            listener.RequestChannel   = requestChannel;
            listener.MessageConverter = new TestMessageConverter();
            Apache.NMS.IMessage nmsMessage = session.CreateTextMessage("test");
            listener.AfterPropertiesSet();
            listener.OnMessage(nmsMessage, session);
        }
        public void CustomMessageConverterDecoratedForHeaderMapping()
        {
            ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();
            IMessageConverter originalConverter          = new TestMessageConverter();

            listener.MessageConverter = originalConverter;
            listener.AfterPropertiesSet();
            HeaderMappingMessageConverter hmmc = GetHmmc(listener);

            Assert.That(hmmc, Is.Not.Null);

            TestMessageConverter smc = hmmc.GetType().GetField("converter", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(hmmc) as
                                       TestMessageConverter;

            Assert.That(smc, Is.Not.Null);
        }
 private HeaderMappingMessageConverter GetHmmc(ChannelPublishingJmsMessageListener listener)
 {
     FieldInfo field = listener.GetType().GetField("messageConverter", BindingFlags.NonPublic | BindingFlags.Instance);
     return field.GetValue(listener) as HeaderMappingMessageConverter;
 }
        private HeaderMappingMessageConverter GetHmmc(ChannelPublishingJmsMessageListener listener)
        {
            FieldInfo field = listener.GetType().GetField("messageConverter", BindingFlags.NonPublic | BindingFlags.Instance);

            return(field.GetValue(listener) as HeaderMappingMessageConverter);
        }