2 Replies Latest reply on Sep 16, 2011 7:58 AM by jaspathewit

    Some messages not delivered to some clients

    jaspathewit

      Hi

       

      We are having problems with message loss between publisher and subscriber an any help or ideas would be gratefully received.

       

      The system is as follows;

       

      Servicemix-3.5.0-fuse-00-00 in a retail environment.

       

      The Servicemix is used to transform and integrate data received from a headquarter system. In addition the ActiveMQ 5.4.0-fuse-00-00 instance (included with servicemix) is used for message traffic within the shop.

       

      The ActiveMQ is configured with two transportConnectors one for ServiceMix and one for message traffic.

       

      A windows service posts durable messages to topics on the activemq broker. The tills durably subscribe to the these topics and recieve the messages.

       

      During the morning there is a high volume of messages (as data is integrated from head quarters) and the Tills are started (They are turned off during the night) they Tills reconnect to the broker and begin to receive and process messages. This happens at the same time as the servicemix is processing data from HQ.

       

      Randomly one of more tills will fail to receive a sequence of messags. The number of missing messages varies between tens and thousands and the tills that don't receive the messages  is also random. The Till does receive messages after the missing messages (ie its a hole in the message flow)

       

      If a till has missing messages the number of messages missed agrees with the number of pending messages reported by the broker for that client. Forcing a re-connection of the client causes the number of pending messages to be set to 0 but the messages are still not sent to the Till.

       

      Madingly we have not been able to reproduce this problem in our test environment.

       

      During the rest of the day the message traffic is lower and servicemix is less intensivly used we have yet to see any message loss in this communication.

        • 1. Re: Some messages not delivered to some clients
          iocanel

          Could you please share a little more details about your activemq configuration (the borker.xml) and the way you setup your consumers?

          • 2. Re: Some messages not delivered to some clients
            jaspathewit

            Active.xml file attached

             

            ActiveMQConnectionFactory is defined as follows in a spring context.

             

                  

                    <property name="brokerURL" value="tcp://$:61616"/>

                       

             

             

            Consumers are created with the following code

             

            public void subscribe(MessageFilter filter) throws JMSException {

                    /* connectionManager manages the connection to the broker its is responsible for creating the connection on re-establishing the connection if dropped, and managing differences between ActiveMQ connections and SonicMQ connections*/

             

                    String clientId = connectionManager.getClientID();

                    if (subscriber == null) {

                        if (receiveSession == null) {

                            receiveSession = connectionManager.getConnection().createSession(false, Session.DUPS_OK_ACKNOWLEDGE);

                        }

                        // get the MQ type (Sonic or activeMQ) specific Topic name (handle wild cards)

                        String topicName = connectionManager.getTopicTransformer().createTopicName(name);

             

                        Topic topic = receiveSession.createTopic(topicName);

                        // get the subscription name to use

                        String subscribtionName = connectionManager.getTopicTransformer().createSubscriptionName(clientId,

                                name);

                        // check if a message filter should be applied

                        if (filter == null) {

                            subscriber = receiveSession.createDurableSubscriber(topic, subscribtionName);

                        }

                        else {

                            subscriber = receiveSession.createDurableSubscriber(topic, subscribtionName, filter.getQuery(), false);

                        }

             

                    }

                }

             

            Thanks for taking an interest.

             

            Jason