-
1. Re: Multiple messages are getting logged in the Topic for a single message push
ataylor Feb 9, 2015 8:35 AM (in response to rakesh.arora)I dont really understand your problem, could you explain more clearly with some example config, code etc.
-
2. Re: Multiple messages are getting logged in the Topic for a single message push
rakesh.arora Feb 9, 2015 9:22 AM (in response to ataylor)Below are the source codes snippets, I used to configure/send the message to topic.
But when I send a single message to Topic, it shows 2 message in the topic [in jboss admin console and in message driven bean].
Let me know, if you need other details.
The below way I configured the topic in jboss:
<jms-topic name="psdFarmPostageRefundTransactionRequestTopic">
<entry name="java:/jboss/topic/psdFarmPostageRefundTransactionRequestTopic"/>
<entry name="java:/jboss/exported/jms/topic/psdFarmPostageRefundTransactionRequestTopic"/>
</jms-topic>
<address-setting match="jms.topic.psdFarmPostageRefundTransactionRequestTopic">
<expiry-address>jms.queue.psdFarmPostageRefundTransactionRequestExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-delivery-attempts>3</max-delivery-attempts>
<redistribution-delay>0</redistribution-delay>
</address-setting>
The below way I configured the JmsTemplate
<bean id="RefundRefillJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="refundConFactory"/>
<property name="defaultDestination" ref="refundRefillRequestQueue"/>
</bean>
<jee:jndi-lookup id="refundConFactory" jndi-name="java:/ConnectionFactory"
resource-ref="false" expected-type="javax.jms.ConnectionFactory"/>
<jee:jndi-lookup id="refundRefillRequestQueue"
jndi-name="java:/jboss/queue/psdFarmPostageRefundTransactionQueue" expected-type="javax.jms.Destination"
resource-ref="false"/>
Java code to send the message:
@Autowired
JmsTemplate RefundRefillJmsTemplate;
this.RefundRefillJmsTemplate.send(new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
TextMessage message = session.createTextMessage(transactionDispenseRequestString);
message.setJMSCorrelationID(correlationId);
return message;
}
});
-
3. Re: Multiple messages are getting logged in the Topic for a single message push
ataylor Feb 9, 2015 9:42 AM (in response to rakesh.arora)and what issue are you exactly seeing?
-
4. Re: Multiple messages are getting logged in the Topic for a single message push
rakesh.arora Feb 10, 2015 3:27 AM (in response to ataylor)2 messages are getting logged in the topic [with the same content] for a single message send using jmstemplate.send() method
-
5. Re: Multiple messages are getting logged in the Topic for a single message push
ataylor Feb 10, 2015 4:02 AM (in response to rakesh.arora)what do you mean by logged? are you saying the MDB is receiving the message twice?
-
6. Re: Multiple messages are getting logged in the Topic for a single message push
rakesh.arora Feb 10, 2015 5:39 AM (in response to ataylor)yes, you are right. MDB is receiving the message twice. Even I am able to see 2 messages in the topic from JBoss console as well.
-
7. Re: Multiple messages are getting logged in the Topic for a single message push
ataylor Feb 10, 2015 5:41 AM (in response to rakesh.arora)it can only be a spring thing, I would remove the spring stuff and run pure JMS as a start point.