[ 
https://issues.apache.org/jira/browse/SYNAPSE-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607118#action_12607118
 ] 

Andreas Veithen commented on SYNAPSE-369:
-----------------------------------------

Normally messages received through the JMS transport are already dispatched to 
the service by the transport listener. The exception seems to indicate that 
this operation failed. Indeed, if the transport doesn't predispatch the 
incoming message, it will be dispatched to __SynapseService by 
SynapseDispatcher. However, this service is only exposed on the HTTP(S) 
transports, explaining the exception in validateTransport.

Why would the dispatching by the JMS message listener fail?

The strategy used by the listener is as follows (see 
JMSMessageReceiver.Worker#run):
(1) Get the destination name (the provider name, not the JNDI name) from the 
JMS message.
(2) Map the JMS destination name to an Axis2 service name using 
JMSConnectionFactory#serviceDestinationNameMapping (which is populated during 
startListeningForService).
The comment "bypass dispatching if we know the service - we already should!" in 
JMSMessageReceiver.Worker#run as well as the code in 
JMSConnectionFactory#getServiceNameForDestination ("hack to get around the 
crazy Active MQ dynamic queue and topic issues") suggests that this strategy is 
not always reliable and may be the root cause of the present issue.

As far as I can see, the (destination name, service name) map used in step (2) 
is only required because the JMS listener uses one JMSMessageReceiver per 
connection factory. Since JMSMessageReceiver is registered with MessageConsumer 
and we have one MessageConsumer per destination/service, I wonder why we don't 
create a separate JMSMessageReceiver per service? In this case 
JMSMessageReceiver would know the service to dispatch to and no longer needs 
serviceDestinationNameMapping. Or am I missing something?

> Multiple instances of Synapse instances cannot form a shared subscription 
> group to Sonic MQ
> -------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-369
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-369
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.1.1, 1.2
>         Environment: Windows XP, JDK 1.6, Sonic MQ 7.5.1
>            Reporter: Tanmay saha
>   Original Estimate: 1344h
>  Remaining Estimate: 1344h
>
> This is a new issue. I am running 2 instances of Synapse-1.1.1 or 
> Synapse-1.2.  Deployed a Proxy over JMS in both instances. Goal is to make 
> sure that when a JNDI Topic Entry is created in Sonic MQ with [[groupprefix]] 
> in front of the actual topic (for example "[[grpsharedsubs]]TopicXA" ), at a 
> time one Synapse instance will receive message from Sonic MQ. But Synapse 
> throws some error. I ran a similar test by uisng a plain java jms client, 
> which works fine in shared subscription mode. I have all the sonic required 
> jars in Synapse\lib folder. The associated configurations are attached here 
> 1)  JNDI Lookup name in Sonic MQ
> 2) JMSTransport config in axis2.xml
> 3) Proxy config in Synapse 
> 4) JMS Transport config in Synapse 
> 5) SynapseError log. 
> JNDI Lookup in Sonic MQ
> =====================================================================
> Lookup Name=TopicXA
> Type                 =Topic
> Destination Name=[[grpsharedsubs]]TopicXA
> JMS Transport configuration in axis2.xml 
> =====================================================================
> <transportReceiver name="jms" 
> class="org.apache.synapse.transport.jms.JMSListener"> 
>         <parameter name="myTopicConnectionFactory"> 
>         <parameter 
> name="java.naming.factory.initial">com.sonicsw.jndi.mfcontext.MFContextFactory</parameter>
>  
>         <parameter 
> name="java.naming.provider.url">tcp://localhost:2506</parameter> 
>         <parameter 
> name="com.sonicsw.jndi.mfcontext.domain">Domain1</parameter> 
>         <parameter 
> name="java.naming.security.principal">Administrator</parameter> 
>         <parameter 
> name="java.naming.security.credentials">Administrator</parameter> 
>         <parameter 
> name="transport.jms.ConnectionFactoryJNDIName">SonicTopicConnectionFactory</parameter>
>  
>                 <parameter name="transport.jms.ConnectionFactoryType" 
> locked="false">topic</parameter> 
>         </parameter> 
>         <parameter name="myQueueConnectionFactory"> 
>         <parameter 
> name="java.naming.factory.initial">com.sonicsw.jndi.mfcontext.MFContextFactory</parameter>
>  
>         <parameter 
> name="java.naming.provider.url">tcp://localhost:2506</parameter> 
>                 <parameter 
> name="com.sonicsw.jndi.mfcontext.domain">Domain1</parameter> 
>         <parameter 
> name="java.naming.security.principal">Administrator</parameter> 
>         <parameter 
> name="java.naming.security.credentials">Administrator</parameter>         
>         <parameter 
> name="transport.jms.ConnectionFactoryJNDIName">SonicQueueConnectionFactory</parameter>
>  
>                 <parameter name="transport.jms.ConnectionFactoryType" 
> locked="false">queue</parameter> 
>         </parameter> 
>     </transportReceiver>     
>     
>     <transportSender name="jms" 
> class="org.apache.synapse.transport.jms.JMSSender"/> 
> Proxy Service Configuration
> ===================================
>  <!--  Introduction to proxy services 
>   --> 
> - <definitions xmlns="http://ws.apache.org/ns/synapse";>
> - <!--  define the request processing XSLT resource as a static URL source 
>   --> 
>   <localEntry key="xslt-key-req" 
> src="file:repository/conf/sample/resources/transform/echo_transform.xslt" /> 
> - <proxy name="echoProxy" transports="jms">
> - <target>
> - <endpoint>
>   <address uri="http://localhost:8082/EJBWebService/EchoBean"; /> 
>   </endpoint>
> - <outSequence>
>   <log level="full" /> 
> - <out>
>   <xslt key="xslt-key-req" /> 
>   </out>
>   <send /> 
>   </outSequence>
>   </target>
>   <parameter 
> name="transport.jms.ConnectionFactory">myTopicConnectionFactory</parameter> 
>   <parameter name="transport.jms.Destination">TopicXA</parameter> 
>   <parameter name="transport.jms.DestinationType">topic</parameter> 
>   <parameter name="transport.jms.ReplyDestination">ReplyTopic</parameter> 
>   <parameter name="transport.jms.ReplyDestinationType">topic</parameter> 
>   <publishWSDL 
> uri="file:repository/conf/sample/resources/proxy/echo_proxy.wsdl" /> 
>   </proxy>
>   </definitions>
> Synapse Error Log
> ================================================================================
> 2008-06-17 13:06:23,933 [10.200.182.100-PS-TSAHA] [WrapperSimpleAppMain]  
> INFO ServerManager Ready for processing 
> 2008-06-17 13:22:49,794 [10.200.182.100-PS-TSAHA] [JMS Session Delivery 
> Thread] DEBUG JMSMessageReceiver Received JMS message to destination : 
> TopicXA 
> Message ID : ID:ffffffffcbed081a:2c060009:11A9831ACB2 
> Correlation ID : null 
> ReplyTo ID : null 
> 2008-06-17 13:22:49,810 [10.200.182.100-PS-TSAHA] [jms-Worker-1] DEBUG 
> JMSListener Error receiving message 
> org.apache.axis2.AxisFault: The service cannot be found for the endpoint 
> reference (EPR) 
>         at 
> org.apache.axis2.engine.DispatchPhase.validateTransport(DispatchPhase.java:216)
>  
>         at 
> org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:93)
>  
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:308) 
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212) 
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132) 
>         at 
> org.apache.synapse.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:210)
>  
>         at 
> org.apache.synapse.transport.jms.JMSMessageReceiver$Worker.run(JMSMessageReceiver.java:201)
>  
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown 
> Source) 
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
>         at java.lang.Thread.run(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to