0
votes

For My Application(Spring boot + ActiveMq), if i consume jms messages inside application its consumes only one time when it comes to another application to this application it consumes 7 times, when look into logs stating that redelivercount has increases one by one and upto 7 times.

Is this configuration issue or someother?

12 Jan 2017 20:34:14,473 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:15,624 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 1, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:16,667 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 2, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:17,725 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 3, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:18,884 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 4, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:19,934 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 5, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

12 Jan 2017 20:34:20,976 [7553] [DefaultMessageListenerContainer-1] INFO com.xerago.rsa.jms.Consumer 21 {} - ActiveMQMapMessage ::: ActiveMQMapMessage {commandId = 5, responseRequired = true, messageId = ID:DWTECH031-44805-1484233018540-1:2:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:DWTECH031-44805-1484233018540-1:2:1:1, destination = queue://soapCall, transactionId = null, expiration = 0, timestamp = 1484233454452, arrival = 0, brokerInTime = 1484233454452, brokerOutTime = 1484233454453, correlationId = Hai, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@6ef648b, marshalledProperties = null, dataStructure = null, redeliveryCounter = 6, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {QuoteId=FHM166963} }

@Component
public class Consumer {

    @JmsListener(destination = "soapCall")
    public String receiveQueue(ActiveMQMapMessage activeMQMapMessage) throws Exception {
        try {
            LOGGER.info("ActiveMQMapMessage ::: " + activeMQMapMessage);
            LOGGER.info("activeMQMapMessage.getJMSCorrelationID() :: " + activeMQMapMessage.getJMSCorrelationID());
            LOGGER.info("activeMQMapMessage.getContentMap() :: " + activeMQMapMessage.getContentMap());
            String Id = activeMQMapMessage.getString("Id");
            return Id;  
        } catch (Exception e) {
            LOGGER.info(e.getMessage(), e);
            throw e;
        }
    }
}

Producer.java

@Component
public class MakeEcall {

    private static final Logger LOGGER = LogManager.getRootLogger();

    @Autowired
    JmsTemplate jmsTemplate;

    public void send(ActiveMQMapMessage activeMQMapMessage) throws Exception {
        this.jmsTemplate.convertAndSend("soapCall", activeMQMapMessage );
        LOGGER.info("Call triggered Successfully.... Posted into JMSQueue for this " + activeMQMapMessage.getString("Id"));
    }
}
1
what did you mean by when it comes to another application to this application ? can you post more logs ?Hassen Bennour
I want to make soap call from success of one service(Application 1) so i separated soap call making process into another application(2).pandiaraj
Application 1 puts that service request into jms and application 2 receives that request, process the request it means making soap callpandiaraj
where are you doing this soap call ? i don't see it in receiveQueue methodHassen Bennour
I planned that before return id; line.pandiaraj

1 Answers

0
votes

so as said in documentation

Annotated methods may have a non-void return type. When they do, the result of the method invocation is sent as a JMS reply to the destination defined by the JMSReplyTO header of the incoming message.

as i see in your logs replyTo = null so your issue is the return type is not void.