We are using Muse on a multicore box (4) with multiple subscribers (10).
Muse didn't scale well as the number of subscribers increased, since the
notify() call is done serially in SimpleSubscriptionManager. To increase
throughput, we batched the NotificationMessages in the notify() as well as
run the notify() in a separate thread from the one invoking
SimpleSubscriptionManager.publish(). By doing this, we are running into
issues EndpointReference being invalide when it is used. We even tried
making copies of them and synchronizing on producer and subscription EPR but
to no avail.
We found on the internet that Xerces DOM is not thread-safe for writing AND
reading, so we were wondering if anyone else is having this issue. Stack
track is below:
java.lang.RuntimeException: [ID = 'InvalidEPRCreated'] The EndpointReference
being copied is invalid. The XML serialization (or deserialization) is
broken - it should not be possible to create an invalid EPR.
at
org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:193)
at
org.apache.muse.ws.notification.impl.SimpleNotificationMessage.setProducerReference(SimpleNotificationMessage.java:205)
at
com.comcept.maritime.xessa.news.ws.notification.impl.BatchingSubscriptionManager.publish(Unknown
Source)
at
com.comcept.maritime.xessa.news.ws.notification.impl.BatchingNotificationProducer.publish(Unknown
Source)
at
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(SimpleNotificationProducer.java:416)
at
com.comcept.maritime.xessa.news.ws.handler.Handler.onMessage(Unknown Source)
at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:840)
at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:96)
at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:165)
at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:111)
at
org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunner.java:26)
at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:44)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.muse.ws.addressing.soap.SoapFault: [ID =
'InvalidAddressURI'] Invalid wsa:Address URI: null
at
org.apache.muse.ws.addressing.EndpointReference.initializeFromXML(EndpointReference.java:537)
at
org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:188)
... 14 more
Caused by: java.lang.NullPointerException
at java.net.URI$Parser.parse(URI.java:3003)
at java.net.URI.<init>(URI.java:578)
at
org.apache.muse.ws.addressing.EndpointReference.initializeFromXML(EndpointReference.java:530)
... 15 more
java.lang.NullPointerException
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at
org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:182)
at
org.apache.muse.ws.notification.impl.SimpleNotificationMessage.setProducerReference(SimpleNotificationMessage.java:205)
at
com.comcept.maritime.xessa.news.ws.notification.impl.BatchingSubscriptionManager.publish(Unknown
Source)
at
com.comcept.maritime.xessa.news.ws.notification.impl.BatchingNotificationProducer.publish(Unknown
Source)
at
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(SimpleNotificationProducer.java:416)
at
com.comcept.maritime.xessa.news.ws.handler.Handler.onMessage(Unknown Source)
at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:840)
at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:96)
at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:165)
at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:111)
at
org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunner.java:26)
at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:44)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "pool-2-thread-7" java.lang.NullPointerException
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at
org.apache.muse.ws.addressing.EndpointReference.<init>(EndpointReference.java:182)
at
org.apache.muse.ws.addressing.MessageHeaders.setFromAddress(MessageHeaders.java:602)
at
org.apache.muse.ws.addressing.soap.SimpleSoapClient.createMessage(SimpleSoapClient.java:108)
at
org.apache.muse.ws.addressing.soap.SimpleSoapClient.send(SimpleSoapClient.java:242)
at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:281)
at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:250)
at
org.apache.muse.ws.notification.remote.NotificationConsumerClient.notify(NotificationConsumerClient.java:95)
at
com.comcept.maritime.xessa.news.ws.notification.impl.BatchingSubscriptionManager.run(Unknown
Source)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
--
View this message in context:
http://www.nabble.com/EndpointReference-thread-safe--tf3506487.html#a9793234
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]