You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "praveen.sharma" <pr...@ll.mit.edu> on 2009/10/22 22:05:21 UTC
Inconsistencies in setting broker URL and the information retrieved
from JmsMessage
I am discovering some inconsistencies in the values I set on the broker URL
(used by the camel endpoint - passed through the spring configuration), and
the values I retrieve from the jms message. In particular, I found
deliveryMode, priority are incorrect. Can someone help me resolve these
inconsistencies.
(following is in a property file given to spring)
brokerURL=tcp://padua.llan.ll.mit.edu:61616?jms.deliveryMode=2&jms.useCompression=true&jms.prefetchPolicy.all=10&jms.messageIdEnabled=true&jms.messageTimestampEnabled=true&jms.priority=9&jms.preserveMessageQos=true&jms.receiveTimeout=1000&jms.timeToLive=1000
(configuration file for jms)
<property name="locations" >
<list>
<value>file:src/main/resources/Broker.properties</value>
<!--
<value>file:${SRC_CODE}/src/main/resources/Broker.properties</value>-->
</list>
</property>
</bean>
...
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${brokerURL}"/>
</bean>
</property>
</bean>
(values retrieved)
jmsExpiration: 0 jmsTimeStamp: 1256241790983 jmsPriority: 4 jmsDeliveryMode:
1 jmsMsgID: ID:padua-37616-1256241782454-0:8:1:1:1 defaultPriority: 4
defaultTTL: 0 defaultDeliveryMode: 2
--
View this message in context: http://www.nabble.com/Inconsistencies-in-setting-broker-URL-and-the-information-retrieved-from-JmsMessage-tp26016324p26016324.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Inconsistencies in setting broker URL and the information
retrieved from JmsMessage
Posted by "praveen.sharma" <pr...@ll.mit.edu>.
OK, I figured out that JMS URI set on camel endpoint, and not the broker URL,
is the one used by JMS Message.
For instance jms endpoint used by camel:
jms:topic:test.MyImgTopic?priority=7&timeToLive=1000&preserveMessageQos=true
are the priorities that I retrieve back:
jmsExpiration: 1256242649150 jmsTimeStamp: 1256242648150 jmsPriority: 7
jmsDeliveryMode: 2 jmsMsgID: ID:padua-37812-1256242647963-0:0:1:1:1
defaultPriority: 4 defaultTTL: 0 defaultDeliveryMode: 2
using code like:
JmsMessage msg = (JmsMessage) exch.getIn();
System.out.println(
" jmsExpiration: " + msg.getJmsMessage().getJMSExpiration()
+ " jmsTimeStamp: " + msg.getJmsMessage().getJMSTimestamp()
+ " jmsPriority: " + msg.getJmsMessage().getJMSPriority()
+ " jmsDeliveryMode: " + msg.getJmsMessage().getJMSDeliveryMode()
+ " jmsMsgID: " + msg.getJmsMessage().getJMSMessageID()
+ " defaultPriority: " + msg.getJmsMessage().DEFAULT_PRIORITY
+ " defaultTTL: " + msg.getJmsMessage().DEFAULT_TIME_TO_LIVE
+ " defaultDeliveryMode: " + msg.getJmsMessage().DEFAULT_DELIVERY_MODE
);
For example
praveen.sharma wrote:
>
> I am discovering some inconsistencies in the values I set on the broker
> URL (used by the camel endpoint - passed through the spring
> configuration), and the values I retrieve from the jms message. In
> particular, I found deliveryMode, priority are incorrect. Can someone
> help me resolve these inconsistencies.
>
> (following is in a property file given to spring)
> brokerURL=tcp://padua.llan.ll.mit.edu:61616?jms.deliveryMode=2&jms.useCompression=true&jms.prefetchPolicy.all=10&jms.messageIdEnabled=true&jms.messageTimestampEnabled=true&jms.priority=9&jms.preserveMessageQos=true&jms.receiveTimeout=1000&jms.timeToLive=1000
>
> (configuration file for jms)
> <property name="locations" >
> <list>
> <value>file:src/main/resources/Broker.properties</value>
> <!--
> <value>file:${SRC_CODE}/src/main/resources/Broker.properties</value>-->
> </list>
> </property>
> </bean>
> ...
> <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="${brokerURL}"/>
> </bean>
> </property>
> </bean>
>
> (values retrieved)
> jmsExpiration: 0 jmsTimeStamp: 1256241790983 jmsPriority: 4
> jmsDeliveryMode: 1 jmsMsgID: ID:padua-37616-1256241782454-0:8:1:1:1
> defaultPriority: 4 defaultTTL: 0 defaultDeliveryMode: 2
>
>
--
View this message in context: http://www.nabble.com/Inconsistencies-in-setting-broker-URL-and-the-information-retrieved-from-JmsMessage-tp26016324p26016629.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.