I am getting this warning in the activemq console, hope this can be safely
ignored. Is there any way to get rid of this. This might be resulting
while setting the property JMSXGroupFirstForConsumer, I am not getting
proper values for this property. It is ok for me as I don't have any logic
that is dependent on it.
WARN QueueSubscription - Failed to set boolean header:
javax.jms.MessageNotWriteableException: Message properties are read-only
javax.jms.MessageNotWriteableException: Message properties are read-only
at
org.apache.activemq.command.ActiveMQMessage.checkReadOnlyProperties(ActiveMQMessage.java:568)
at
org.apache.activemq.command.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:382)
at
org.apache.activemq.command.ActiveMQMessage.setBooleanProperty(ActiveMQMessage.java:534)
at
org.apache.activemq.broker.region.QueueSubscription.assignGroupToMe(QueueSubscription.java:134)
at
org.apache.activemq.broker.region.QueueSubscription.canDispatch(QueueSubscription.java:101)
at
org.apache.activemq.broker.region.PrefetchSubscription.dispatch(PrefetchSubscription.java:383)
at
org.apache.activemq.broker.region.QueueSubscription.dispatch(QueueSubscription.java:172)
at
org.apache.activemq.broker.region.PrefetchSubscription.add(PrefetchSubscription.java:129)
at
org.apache.activemq.broker.region.Queue.addSubscription(Queue.java:19
Kamal wrote:
>
> I wasn't setting the body, I was assuming that it would copy over the body
> from in to out if I don't explicitly set it. I changed the processor as
> follows and it worked
>
> public class GroupIdInsertionProcessor implements Processor {
> public void process(Exchange exchange) throws Exception {
> Message inMessage = exchange.getIn();
> exchange.getOut().copyFrom(inMessage);
> exchange.getOut().setHeader("JMSXGroupID",inMessage.getBody());
> }
> }
>
> Thank you for the help.
>
>
>
>
>
>
> James.Strachan wrote:
>>
>> BTW am wondering if the issue is that the processor doesn't create an
>> OUT body - so its gonna reuse the IN? e.g. I wonder if you set the
>> header on the IN, or set some kinda OUT body?
>>
>> On 27/02/2008, Kamal <[EMAIL PROTECTED]> wrote:
>>>
>>> We are using camel 1.2.0 and activemq 4.1.1. Should I try with the 1.3
>>> snapshot.
>>>
>>>
>>>
>>> James.Strachan wrote:
>>> >
>>> > Which version of Camel are you using BTW? Just wondered if this has
>>> > been fixed since 1.2.0 (we so need 1.3.0 to be released! :)
>>> >
>>> > On 27/02/2008, Kamal <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >> I am trying to set the JMXGroupId property from within a processor
>>> using
>>> >> the
>>> >> following code.
>>> >> exchange.getOut().setHeader("JMSXGroupID",groupId);
>>> >> which doesn't work.
>>> >>
>>> >> I also tried to get hold of the underlying JMSMessage by casting
>>> the
>>> >> Message
>>> >> object, but the underlying JMS message object is null.
>>> >> Message outMessage = exchange.getOut();
>>> >> JmsMessage jmsOutMessage = (JmsMessage) outMessage;
>>> >> javax.jms.Message underlyingMessage =
>>> >> jmsOutMessage.getJmsMessage();
>>> >> System.out.println("underlyingMessage" +
>>> >> underlyingMessage);
>>> >>
>>> >> The requirement is to extract information from the message and set
>>> it as
>>> >> a
>>> >> JMSXGroupID. We don't have control over the producer. We are
>>> using
>>> >> ActiveMQ, with Camel embedded within the broker.
>>> >>
>>> >> The following is my camel context configuration
>>> >> <camelContext
>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>> >> <route>
>>> >> <from uri="activemq:testQ-input"/>
>>> >> <process ref="groupIdInsertionProcessor"/>
>>> >> <to uri="activemq:testQ-output"/>
>>> >> </route>
>>> >> </camelContext>
>>> >>
>>> >> <bean id="groupIdInsertionProcessor"
>>> >> class="xx.GroupIdInsertionProcessor"/>
>>> >>
>>> >> public class GroupIdInsertionProcessor implements Processor {
>>> >> public void process(Exchange exchange) throws Exception {
>>> >> Message inMessage = exchange.getIn();
>>> >>
>>> >> exchange.getOut().setHeader("JMSXGroupID",inMessage.getBody());
>>> >> }
>>> >> }
>>> >>
>>> >>
>>> >> Thanks for the help.
>>> >>
>>> >> Regards,
>>> >> Kamal
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/setting-JMSXGroupId-property-from-within-a-processor-tp15706825s22882p15706825.html
>>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > James
>>> > -------
>>> > http://macstrac.blogspot.com/
>>> >
>>> > Open Source Integration
>>> > http://open.iona.com
>>> >
>>> >
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/setting-JMSXGroupId-property-from-within-a-processor-tp15706825s22882p15707114.html
>>>
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://open.iona.com
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/setting-JMSXGroupId-property-from-within-a-processor-tp15706825s22882p15707773.html
Sent from the Camel - Users mailing list archive at Nabble.com.