Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Priyanshu Shukla
    @priyanshus1

    @artembilan
    Yeah sorry it was missing code, I actually created a targetFactory using Qpid and injected it CachingConnectioFactory everything seems to work when I publish a message, but when I try to receive I see a delay in listener and message is received and then @JmsLisneter crashes I get this QPID error in console

    2019-09-04 11:49:48.224  WARN 21725 --- [-6777ebb5153a:1] o.a.qpid.jms.util.QpidJMSThreadFactory   : Thread: QpidJMS Connection Executor: ID:5b1e1c76-8c04-4d68-8e89-6777ebb5153a:1 failed due to an uncaught exception: null
    2019-09-04 11:49:48.224  INFO 21725 --- [-6777ebb5153a:1] org.apache.qpid.jms.JmsSession           : A JMS MessageConsumer has been closed: JmsConsumerInfo: { ID:5b1e1c76-8c04-4d68-8e89-6777ebb5153a:1:4:1, destination = inbound1 }
    2019-09-04 11:49:48.225  WARN 21725 --- [-6777ebb5153a:1] o.a.qpid.jms.util.QpidJMSThreadFactory   : Thread: QpidJMS Connection Executor: ID:5b1e1c76-8c04-4d68-8e89-6777ebb5153a:1 failed due to an uncaught exception: null
    2019-09-04 11:49:53.216  WARN 21725 --- [enerContainer-7] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'randomQueueName' - trying to recover. Cause: Remote did not respond to a drain request in time
    2019-09-04 11:49:58.220  WARN 21725 --- [nerContainer-12] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'randomQueueName' - trying to recover. Cause: The MessageConsumer was closed due to an unrecoverable error.
    2019-09-04 11:50:03.226  WARN 21725 --- [nerContainer-21] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'randomQueueName' - trying to recover. Cause: The MessageConsumer was closed due to an unrecoverable error.
    2019-09-04 11:50:04.590  INFO 21725 --- [n(14)-127.0.0.1] inMXBeanRegistrar$SpringApplicationAdmin : Application shutdown requested.
    2019-09-04 11:50:04.592  WARN 21725 --- [nerContainer-22] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'randomQueueName' - trying to recover. Cause: The MessageConsumer was closed due to an unrecoverable error.
    2019-09-04 11:50:34.597  INFO 21725 --- [n(14)-127.0.0.1] o.s.c.support.DefaultLifecycleProcessor  : Failed to shut down 1 bean with phase value 2147483647 within timeout of 30000: [org.springframework.jms.config.internalJmsListenerEndpointRegistry]
    2019-09-04 11:50:34.602  INFO 21725 --- [n(14)-127.0.0.1] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

    Remember I am trying to use Qpid JMS AMQP 1.0 with Spring to connect rabbitmq over AMQP1.0 prorocol
    This actually works for other MQs which support AMQP1.0 protocol

    I understand this may not be correct channel to ask this question but I am just seeking help from channel I know would reply :D
    Artem Bilan
    @artembilan
    @priyanshus1 , I think you need to consult with RabbitMQ team about the best Java client for their AMQP 1.0 support: https://groups.google.com/forum/#!forum/rabbitmq-users
    Priyanshu Shukla
    @priyanshus1
    @artembilan good point
    thanks
    :+1:
    Artem Bilan
    @artembilan
    I thought that one is for regular RabbitMQ AMQP 0.9 protocol and not for AMQP 1.0 ...
    Gary Russell
    @garyrussell
    Right - but it's supported by the RabbitMQ team, unlike QPID.
    Artem Bilan
    @artembilan
    The question was to enable AMQP 1.0 plugin on RabbitMQ and find some JMS client which could work with that
    I'm just not sure that RabbitMQ JMS Client is AMQP 1.0 compliant...
    Gary Russell
    @garyrussell
    It's not; the question should be why you would want to use an unsupported software stack Vs. a supported one. i.e. what is the compelling reason to use 1.0 ?
    Artem Bilan
    @artembilan
    Oh! This is not the question, but more like instruction for action. So, good point, Gary! :smile:
    Yuval Bonen
    @yuvalprtn
    Hi
    Hi have this code
    @Configuration
    public class RabbitTemplateConfiguration {
    
      RabbitTemplateConfiguration(RabbitTemplate rabbitTemplate){
        rabbitTemplate.setAfterReceivePostProcessors(new AuthenticationAwareMessagePostProcessor());
      }
    }
    But for some reason the AuthenticationAwareMessagePostProcessor is never called
    If I use setBeforePublishPostProcessors it is being called, but I need the "filter" on the receiving side
    Using SpringBoot 2.1.8
    Gary Russell
    @garyrussell

    @yuvalprtn Works fine for me...

    @SpringBootApplication
    public class Gitter53Application {
    
        public static void main(String[] args) {
            SpringApplication.run(Gitter53Application.class, args);
        }
    
        @Bean
        public ApplicationRunner runner(RabbitTemplate template) {
            return args -> {
                template.convertAndSend("foo", "bar");
                System.out.println(template.receive("foo", 10_000L));
            };
        }
    
    }
    
    @Configuration
    class RabbitTemplateConfiguration {
    
        RabbitTemplateConfiguration(RabbitTemplate rabbitTemplate) {
            rabbitTemplate.setAfterReceivePostProcessors(msg -> {
                System.out.println("In MPP: " + msg);
                return msg;
            });
        }
    
    }

    In MPP: (Body:'bar' ...
    (Body:'bar' ...

    Yuval Bonen
    @yuvalprtn
    Thanks @garyrussell we are working with @RabbitListener
    Gary Russell
    @garyrussell
    Then you need to inject it into the listener container factory, not the template.
    The template is not used by @RabbitListeners
    @SpringBootApplication
    public class Gitter53Application {
    
        public static void main(String[] args) {
            SpringApplication.run(Gitter53Application.class, args);
        }
    
        @Bean
        public ApplicationRunner runner(RabbitTemplate template) {
            return args -> {
                template.convertAndSend("foo", "bar");
            };
        }
    
        @RabbitListener(queues = "foo")
        public void listen(String in) {
            System.out.println(in);
        }
    
    }
    
    @Configuration
    class ContainerFactoryConfiguration {
    
        ContainerFactoryConfiguration(AbstractRabbitListenerContainerFactory<?> factory) {
            factory.setAfterReceivePostProcessors(msg -> {
                System.out.println("In MPP: " + msg);
                return msg;
            });
        }
    
    }
    Yuval Bonen
    @yuvalprtn
    @garyrussell :heart: :wink:
    Thanks, will give it a shot!
    Yuval Bonen
    @yuvalprtn
    Works like a charm, thanks
    Ankit
    @ankitneosharma_gitlab
    I am in a process of re-writing my application in Springboot. This application was earlier written using a middleware product.I am facing issue with the MQ header size that being generated, its almost double the size in Springboot to what it was when I was using the midleware product. When the consumer is trying to process the message it fails the request due to large header. The consumer is limiting the buffer size to limit the header size.
    Gary Russell
    @garyrussell
    Much more information is needed; what header? what contents? why is it bigger? BTW this room is for RabbitMQ but we can discuss this here.
    Ankit
    @ankitneosharma_gitlab
    Its the RFH header, below are the contents of the header. I am not sure why is it bigger, I am looking for that answer myself. My initial assumption was that the header included both RFH and RFH2 but that wasn't the case. We had TargetClient=MQ which would eliminate the RFH2 headers from the request.
    MQ GET RESPONSE
    WS-OUTPUT-BUFFER:RFH *4MQSTR Ï´∑∞é¥û∞(Ω¥û|Ω™æµ¬æ∞(Ω¥û∞é¥û∑∑ë∞|Ωû∞ÖΩæûêÛµÛµÈä§É†âÉ
    Ñ<…§(â§+äàâäà†&<·∞ÖΩæû∞äΩû⁄fl‡Â›Âfi„fi∞äΩû∞Ñ•¥û§ÖÈ雵¥„fiŸé›µ¥„µfiŸfiŸfiŸfiŸfiŸfiŸfiŸfiŸ¥‡éfiflé›∂éé„„fi„⁄Ÿ∞Ñ•¥û∞Ö%¿û∞Ö
    %¿û∞|_Ωû∫∞ÛΩºû∞ÑÑâ§Ö∑¥æ±•fiû„⁄Â∞ÑÑâ§Öû∞∂/•%§∂ÇÛ•µΩéµ∑¥æ±•fiû⁄∞∂/•%§∂ÇÛ•µΩéµû∞µ>é?¥•>è∑¥æ±•fiû›∞µ>é?¥•>èû∞ÛΩ
    ºû∑∑∑<?xml version="1.0" encoding="UTF-8"?>
    Gary Russell
    @garyrussell
    Sorry, I have no idea why the header would be larger when using Spring.
    Adder Huang
    @Flyyellow
    ?
    this is a chat room?
    Jimmy Bway
    @jselamy
    Is this the right channel is i have question regarding reactor-rabbitmq even if i see it's spring-amqp ?
    Artem Bilan
    @artembilan
    Yeah... we would like to help, but that project is out of our attention. Would be better to ask RabbitMQ community on their Google group: https://groups.google.com/forum/m/#!forum/rabbitmq-users
    Jimmy Bway
    @jselamy
    thanks @artembilan this was why I asked
    mondaymorning04
    @mondaymorning04
    how can i listen to a message from rabbitmq and stream the response to ui using webflux or something. if any example is handy, please share.
    Priyanshu Shukla
    @priyanshus1
    Hello Folks
    I have a situation when all my channels gets killed, connection recovery does not happens.
    And client does not re-establish connection.
    Priyanshu Shukla
    @priyanshus1
    @garyrussell Can you explain why autorecovery is disabled in caching connection factory and why it is discouraged to use it. If spring AMQP has a autorecovery mechanism it is not working in my case where I am using SimpleRabbitListenerContainerFactory with caching connection factory :) cc: @artembilan
    Gary Russell
    @garyrussell

    @priyanshus1 Because Spring AMQP has had its own recovery mechanism that predates auto recovery by several years (since 2010); we tried to make it compatible with auto recovery but it was like whack-a-mole to kill the bugs; even if it's enabled now, we kill the recovery.

    The listener container goes into recovery mode after a connection failure. If you are not seeing that, something is wrong; turn on DEBUG logging to figure out what's going on. If you can't figure it out, provide a simple example that exhibits the behaviour you see.

    Priyanshu Shukla
    @priyanshus1
    @garyrussell the situation is we have no concrete way to reproduce this issue. It happens some time where we have two cases 1. Some time we loose the connectinon and 2. Some time loose all our channels and the it does not recover. In second case do you think there is a need to reset the listener ?
    Gary Russell
    @garyrussell

    There should be no circumstances where recovery doesn't work. One exception to that is the use of auto-delete queues on an HA cluster, where the master-locator is not client-local (i.e. the queue is created on a different node to the one we are connected to and that node goes down). The container will stop itself after 15 seconds if it can't reconnect to its queue.

    We changed the AnonymousQueue to use client-local by default in version 2.1.

    If you are creating your own auto-delete queues, you must set the master-locator, either as an argument or a policy on the broker.

    Priyanshu Shukla
    @priyanshus1
    @garyrussell we are not using auto delete queues, we are using persistent queues. And now we have seen this issue 3 times that we lost all the channels and application did not recover them.
    So we are really worried how to fix this.
    Gary Russell
    @garyrussell
    What version are you using? All the recovery information should be in the log.
    If you are using an old version with auto-recovery enabled; you will have problems.
    Priyanshu Shukla
    @priyanshus1
    spring-amqp 2.1.12.RELEASE is our version and so far we have not done any setting to enable auto-recovery. So its default behaviour
    @garyrussell
    Gary Russell
    @garyrussell
    So something else is going on; there is nothing that would prevent recovery from succeeding unless the container threads a are "stuck" in user code, a thread dump would show that.