You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Tanmay saha (JIRA)" <ji...@apache.org> on 2008/07/15 20:51:31 UTC

[jira] Updated: (SYNAPSE-369) Multiple instances of Synapse instances cannot form a shared subscription group to Sonic MQ

     [ https://issues.apache.org/jira/browse/SYNAPSE-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tanmay saha updated SYNAPSE-369:
--------------------------------

    Attachment: SharedSubscriptions.java
                Readme.txt
                mq_getstart.pdf

Hi Asankha:

It is difficult to get publicly available Sonic MQ Documentation. I am sharing the one which I have.

Please refer to page no. 56 of the attached pdf.


I am attaching the example source from sonic also.

<parameter name="transport.jms.Destination"> element of Synapse Proxy refers to the JNDI Lookup name of the JMS destination. But the shared subscription group name prefix has to be in front of the actual destination name.


Right now I have made the following changes in addDestination() method of JMSConnectionFactory.java and it is working fine. Since I do not know the purpose of serviceDestinationNameMapping, this was the simple and quick fix for me.

  /**
        serviceDestinationNameMapping.put(destinationName, serviceName);

        log.info("Mapped JNDI name : " + destinationJNDIName + " and JMS Destination name : " +
            destinationName + " against service : " + serviceName);

        */

        /** Added to remove the [[sharedsubs-group-prefix]] from the destination name, before populating the  serviceDestinationNameMapping **/

        int index = destinationName.indexOf("]");

        if( index > 0 )
        {
                        String tempdestinationName=destinationName.substring(index+2);
                serviceDestinationNameMapping.put(tempdestinationName, serviceName);

                log.info("Mapped JNDI name : " + destinationJNDIName + " and JMS Destination name : " +
                    tempdestinationName + " against service : " + serviceName);

                }
        else
        {

                serviceDestinationNameMapping.put(destinationName, serviceName);

                log.info("Mapped JNDI name : " + destinationJNDIName + " and JMS Destination name : " +
                    destinationName + " against service : " + serviceName);
        }


Pl feel free to contact me, if you need any more info.

-Thanks
tanmay





> 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
>            Assignee: Asankha C. Perera
>         Attachments: mq_getstart.pdf, Readme.txt, SharedSubscriptions.java
>
>   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: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org