Sometimes messageListener doesn't receive messages.

Version 1

    Hello,

    Here is a slice of code which register messageListener with delegator.

    It listens a queue, but I see that sometimes it doesn't receive messages at all or receive after some time.

    When I launch my code again it can receive messages with described above conditions.

    Could you please explain where is the problem?

     

    SimpleMessageListenerContainer messageListener = new SimpleMessageListenerContainer();
    messageListener.setSessionAcknowledgeMode(javax.jms.Session.AUTO_ACKNOWLEDGE);
    messageListener.setSessionTransacted(true);
    messageListener.setConnectionFactory(getCConnectionFactory());
    messageListener.setDestinationName(endpointAddress);
    messageListener.setMessageListener(new JMSMessageDelegator(coreProcessor));
    // messageListener.setConcurrentConsumers(concurrentConsumers);
    // messageListener.setClientId(endpointAddress +
    // UUID.randomUUID().toString());
    // messageListener.setCacheLevel(DefaultMessageListenerContainer.CACHE_AUTO);
    messageListener.start();