[mule-user] Setting Message property from non-ower thread

0 views
Skip to first unread message

Bill Graham

unread,
Oct 28, 2008, 4:53:08 PM10/28/08
to Mule users
Hi,

I'm using EventListeners to listen for state changes of my messages as they go from endpoints to services, etc. I then persist info regarding the state of the message. From my listener I need to set a property on the message though to help track the state. When I try though, I get this exception:

[2008/Oct/28 13:42:46.103] [MuleServer.1] WARN AbstractMessageAdapter.java:581 Message access violation
java.lang.IllegalStateException: Only owner thread can write to message: Thread[resin-tcp-connection-*:8080-2,5,main]/Thread[MuleServer.1,5,main]
at org.mule.transport.AbstractMessageAdapter.newException(AbstractMessageAdapter.java:580)
at org.mule.transport.AbstractMessageAdapter.checkMutable(AbstractMessageAdapter.java:566)
at org.mule.transport.AbstractMessageAdapter.assertAccess(AbstractMessageAdapter.java:507)
at org.mule.transport.AbstractMessageAdapter.setProperty(AbstractMessageAdapter.java:229)
at org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:284)
at foo.mule.MuleUtils.incrementSequence(MuleUtils.java:22)
at foo.mule.listeners.MuleMessageEventListener.onNotification(MuleMessageEventListener.java:91)
at org.mule.context.notification.Sender.dispatch(Sender.java:40)
at org.mule.context.notification.Policy.dispatch(Policy.java:127)
at org.mule.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:211)
at org.mule.context.notification.ServerNotificationManager.run(ServerNotificationManager.java:231)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:595)

Any ideas how I can work around this issue? I basically need a way to set a value on a message and then check that value later. The problem seems the be that I'm doing this from a thread that's not the owner.

thanks,
Bill

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Reply all
Reply to author
Forward
0 new messages