You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by kbohnenberger <ke...@mantech.com> on 2009/04/08 16:12:59 UTC

SNAPSHOT JMS publisher

I'm looking at
http://people.apache.org/~veithen/synapse/Synapse_Samples.html#Sample250
to create a jms publisher.
I have it "working" with the long uri in the address that sets all the
connection params locally in the sequence like this:
    <sequence name="sendJMSKoList">
    	<send>
    	   <endpoint>
              <address
uri="jms:/cn=keithQueue1?transport.jms.ConnectionFactoryJNDIName=cn=marklogicXCF&amp;java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory&amp;java.naming.provider.url=ldap://servicelayer-dev:389/o=imq&amp;transport.jms.DestinationType=queue"/>    	         
    	   </endpoint>
    	</send>
    </sequence>


However, after this runs for a while I start getting connection exceptions.  
It seems like this is creating a new connection every time it publishes.

Can I configure the address to point to the connection factory that I have
in the axis2.xml file?
If so, what is the syntax?  I tried "guessing" but couldn't get it to work.


Thanks

Keith
-- 
View this message in context: http://www.nabble.com/SNAPSHOT-JMS-publisher-tp22951348p22951348.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: SNAPSHOT JMS publisher

Posted by Andreas Veithen <an...@gmail.com>.
I had some time to investigate this further, and I identified at least
two issues that (may) explain the problems you describe: WSCOMMONS-467
and WSCOMMONS-468.

Andreas

On Tue, Apr 14, 2009 at 00:00, Keith Bohnenberger
<ke...@mantech.com> wrote:
> At this point I'm a little lost on this thread but ....
>
>
>
>>>>> Why do you have
>>>>> ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why
>>>>> =cn=..?
>
> The"cn=" was a typo and should not be there.  I did try this with the
> factory name that was in my axis2.xml file.
>
>>>>>
>>>>
>>>> I'm trying to use the connectionfactory that is set in the axis2.xml file
>>>> in
>>>> the "JMSSender" section. Similar to how the jms proxy uses the connection
>>>> factory in the JMSListener for listening to the queue.
>>>>
>>>
>>> To do this, define one or more connection factories in the sender as
>>> follows.. the names does not really matter, as you *must* continue to
>>> provide the full address URL when sending to a destination. Internally the
>>> sender will check if a CF is defined, and if so use it as appropriate
>>
>> That is actually not true: you can refer to a connection factory
>> definition in axis2.xml explicitly using the
>> transport.jms.ConnectionFactory parameter.
>>
>
> In the SNAPSHOT that I have, it is true that you can refer to a connection
> factory definition in axi2.xml explicitly.  However, if you don't set the
> other parameters as well you get an error when you bring up Synapse and your
> mediator doesn't deploy.  I can't remember if you have to set all of the
> params shown in sample 251 but having only the following set does not work:
> <address uri="jms:/myDest?transport.jms.ConnectionFactory=myConnFact"/>
> Even though I had the "myConnFact" in the axis2.xml file, this alone would
> not deploy because it complained that I needed the other params set at well.
>
> With both the connection factory explicitly set and the other params I had
> to set to get passed the deployment error, I ran into the same JNDI
> connection problems that I was running into with the
> connectionfactoryjndiname set as a param.
>
>
>
>
>
>
> This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.
> If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.
> If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.
>
>

Re: SNAPSHOT JMS publisher

Posted by Keith Bohnenberger <ke...@mantech.com>.
At this point I'm a little lost on this thread but ....



>>>> Why do you have
>>>> ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why
>>>> =cn=..?

The"cn=" was a typo and should not be there.  I did try this with the
factory name that was in my axis2.xml file.

>>>> 
>>> 
>>> I'm trying to use the connectionfactory that is set in the axis2.xml file
>>> in
>>> the "JMSSender" section. Similar to how the jms proxy uses the connection
>>> factory in the JMSListener for listening to the queue.
>>> 
>> 
>> To do this, define one or more connection factories in the sender as
>> follows.. the names does not really matter, as you *must* continue to
>> provide the full address URL when sending to a destination. Internally the
>> sender will check if a CF is defined, and if so use it as appropriate
> 
> That is actually not true: you can refer to a connection factory
> definition in axis2.xml explicitly using the
> transport.jms.ConnectionFactory parameter.
> 

In the SNAPSHOT that I have, it is true that you can refer to a connection
factory definition in axi2.xml explicitly.  However, if you don't set the
other parameters as well you get an error when you bring up Synapse and your
mediator doesn't deploy.  I can't remember if you have to set all of the
params shown in sample 251 but having only the following set does not work:
<address uri="jms:/myDest?transport.jms.ConnectionFactory=myConnFact"/>
Even though I had the "myConnFact" in the axis2.xml file, this alone would
not deploy because it complained that I needed the other params set at well.

With both the connection factory explicitly set and the other params I had
to set to get passed the deployment error, I ran into the same JNDI
connection problems that I was running into with the
connectionfactoryjndiname set as a param.






This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.  
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.  
If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.


Re: SNAPSHOT JMS publisher

Posted by Andreas Veithen <an...@gmail.com>.
On Wed, Apr 8, 2009 at 19:31, Asankha C. Perera <as...@apache.org> wrote:
> Keith
>>>
>>> Why do you have
>>> ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why
>>> =cn=..?
>>>
>>
>> I'm trying to use the connectionfactory that is set in the axis2.xml file
>> in
>> the "JMSSender" section. Similar to how the jms proxy uses the connection
>> factory in the JMSListener for listening to the queue.
>>
>
> To do this, define one or more connection factories in the sender as
> follows.. the names does not really matter, as you *must* continue to
> provide the full address URL when sending to a destination. Internally the
> sender will check if a CF is defined, and if so use it as appropriate

That is actually not true: you can refer to a connection factory
definition in axis2.xml explicitly using the
transport.jms.ConnectionFactory parameter.

> <transportSender name="jms"
> class="org.apache.axis2.transport.jms.JMSSender">
>   <parameter name="myTopicConnectionFactory">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
>       <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
>       <parameter name="transport.jms.CacheLevel">producer</parameter>
>   </parameter>
>
>   <parameter name="myQueueConnectionFactory">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
>       <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
>       <parameter name="transport.jms.CacheLevel">producer</parameter>
>   </parameter>
>
>   <parameter name="default">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">ConnectionFactory</parameter>
>       <parameter name="transport.jms.CacheLevel">connection</parameter>
>   </parameter>
> </transportSender>
>
> Ref:
> http://adroitlogic.org/knowledge-base-axis2/9-the-enhanced-jms-transport.html
>
>
>>> Please share the full synapse.xml, axis2.xml and the log files
>>>
>>
>> See attached
>>
>
> I do not see anything attached?
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

Re: SNAPSHOT JMS publisher

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Keith
> Can you point me to the code in synapse that ends up getting called for a
> "jms address?"  I tried a bunch of parameters and it still seems to be
> creating a connection every time.
>   
https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/transport/modules/jms

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: SNAPSHOT JMS publisher

Posted by Keith Bohnenberger <ke...@mantech.com>.
Can you point me to the code in synapse that ends up getting called for a
"jms address?"  I tried a bunch of parameters and it still seems to be
creating a connection every time.


On 4/9/09 2:59 AM, "Asankha C. Perera" <as...@apache.org> wrote:

> Hi Andreas
>> Asankha,
>> 
>> There are still some very large gaps in the documentation of the JMS
>> transport. I think we should try to complete that before the release
>> of the 1.0 version. Can I count on you?
>>   
> Yes.. I will do my best to complete this.. if you, or someone else could
> do me a favor and prepare a TOC, that would help a lot, since then I
> could go along that and make sure that all required options are covered
> as much as possible, and the optional ones according to the time we have
> left. I have been a bit busy this week with some unexpected problems,
> and most of Sri Lanka will be on vacation till mid next week due to the
> local new year.. So I will do my best
> 
> thanks
> asankha

This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.  
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.  
If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.


Re: SNAPSHOT JMS publisher

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Andreas
> Asankha,
>
> There are still some very large gaps in the documentation of the JMS
> transport. I think we should try to complete that before the release
> of the 1.0 version. Can I count on you?
>   
Yes.. I will do my best to complete this.. if you, or someone else could 
do me a favor and prepare a TOC, that would help a lot, since then I 
could go along that and make sure that all required options are covered 
as much as possible, and the optional ones according to the time we have 
left. I have been a bit busy this week with some unexpected problems, 
and most of Sri Lanka will be on vacation till mid next week due to the 
local new year.. So I will do my best

thanks
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: SNAPSHOT JMS publisher

Posted by Andreas Veithen <an...@gmail.com>.
Asankha,

There are still some very large gaps in the documentation of the JMS
transport. I think we should try to complete that before the release
of the 1.0 version. Can I count on you?

Andreas

On Wed, Apr 8, 2009 at 19:31, Asankha C. Perera <as...@apache.org> wrote:
> Keith
>>>
>>> Why do you have
>>> ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why
>>> =cn=..?
>>>
>>
>> I'm trying to use the connectionfactory that is set in the axis2.xml file
>> in
>> the "JMSSender" section. Similar to how the jms proxy uses the connection
>> factory in the JMSListener for listening to the queue.
>>
>
> To do this, define one or more connection factories in the sender as
> follows.. the names does not really matter, as you *must* continue to
> provide the full address URL when sending to a destination. Internally the
> sender will check if a CF is defined, and if so use it as appropriate
>
> <transportSender name="jms"
> class="org.apache.axis2.transport.jms.JMSSender">
>   <parameter name="myTopicConnectionFactory">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
>       <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
>       <parameter name="transport.jms.CacheLevel">producer</parameter>
>   </parameter>
>
>   <parameter name="myQueueConnectionFactory">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
>       <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
>       <parameter name="transport.jms.CacheLevel">producer</parameter>
>   </parameter>
>
>   <parameter name="default">
>       <parameter
> name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
>       <parameter
> name="java.naming.provider.url">tcp://localhost:61616</parameter>
>       <parameter
> name="transport.jms.ConnectionFactoryJNDIName">ConnectionFactory</parameter>
>       <parameter name="transport.jms.CacheLevel">connection</parameter>
>   </parameter>
> </transportSender>
>
> Ref:
> http://adroitlogic.org/knowledge-base-axis2/9-the-enhanced-jms-transport.html
>
>
>>> Please share the full synapse.xml, axis2.xml and the log files
>>>
>>
>> See attached
>>
>
> I do not see anything attached?
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

Re: SNAPSHOT JMS publisher

Posted by "Asankha C. Perera" <as...@apache.org>.
Keith
>> Why do you have ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why =cn=..?
>>     
> I'm trying to use the connectionfactory that is set in the axis2.xml file in
> the "JMSSender" section. Similar to how the jms proxy uses the connection
> factory in the JMSListener for listening to the queue.
>   
To do this, define one or more connection factories in the sender as 
follows.. the names does not really matter, as you *must* continue to 
provide the full address URL when sending to a destination. Internally 
the sender will check if a CF is defined, and if so use it as appropriate

<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender">
    <parameter name="myTopicConnectionFactory">
        <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
        <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
        <parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
        <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
        <parameter name="transport.jms.CacheLevel">producer</parameter>
    </parameter>

    <parameter name="myQueueConnectionFactory">
        <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
        <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
        <parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
        <parameter name="transport.jms.JMSSpecVersion">1.0.2b</parameter>
        <parameter name="transport.jms.CacheLevel">producer</parameter>
    </parameter>

    <parameter name="default">
        <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
        <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
        <parameter name="transport.jms.ConnectionFactoryJNDIName">ConnectionFactory</parameter>
        <parameter name="transport.jms.CacheLevel">connection</parameter>
    </parameter>
</transportSender>

Ref: http://adroitlogic.org/knowledge-base-axis2/9-the-enhanced-jms-transport.html


>> Please share the full synapse.xml, axis2.xml and the log files
>>     
> See attached
>   
I do not see anything attached?

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: SNAPSHOT JMS publisher

Posted by Keith Bohnenberger <ke...@mantech.com>.
>> This is what I've been trying:
>>     <sequence name="sendJMSKoList">
>> <send>
>>   <endpoint>
>>     <address  
>> uri="jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactor
>> y&amp;transport.jms.DestinationType=queue"/>
>>   </endpoint>
>> </send>
>>     </sequence>
>>   
> Why do you have 
> ..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why
> =cn=..?

I'm trying to use the connectionfactory that is set in the axis2.xml file in
the "JMSSender" section. Similar to how the jms proxy uses the connection
factory in the JMSListener for listening to the queue.

I have this "working" with the full uri that spells out all the JMS
connection info similar to
http://people.apache.org/~veithen/synapse/Synapse_Samples.html#Sample250
But after it runs for a while I get connection exceptions.  It seems like it
is creating a new connection every time it publishes.  I was hoping that by
using the connection factory in the axis2.xml file, it would take care of
that problem.

>> In axis2.xml, this is what the jmssender looks like:
>>         <parameter name="outgoingQueueFactory">
>>             <parameter
>> name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</paramete
>> r>
>>             <parameter
>> name="java.naming.provider.url">ldap://servicelayer-dev:389/o=imq</parameter>
>>             <parameter
>> name="transport.jms.ConnectionFactoryJNDIName">cn=marklogicXCF</parameter>
>>         </parameter>
>> 
>> 
>> This is the error I get:
>> ERROR JMSOutTransportInfo Cannot locate destination : cn=testQueue using
>> jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactory&tra
>> nsport.jms.DestinationType=queue
>> javax.naming.NoInitialContextException: Need to specify class name in
>> environment or system property, or as an applet parameter, or in an
>> application resource
>>   
> Have you placed the JAR containing LdapCtxFactory (and any of its
> dependencies) into the lib directory?
Yes, all needed jars are in the lib directory.  Like I said, it all "works"
when I have the full uri in the synapse.xml but after a while I get
connection errors.


> 
> Please share the full synapse.xml, axis2.xml and the log files
See attached

> 
> cheers
> asankha

This communication, along with any attachments, is covered by federal and state law governing electronic communications and may contain company proprietary and legally privileged information.  
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, use or copying of this message is strictly prohibited.  
If you have received this in error, please reply immediately to the sender and delete this message.  Thank you.

Re: SNAPSHOT JMS publisher

Posted by "Asankha C. Perera" <as...@apache.org>.
Keith
> This is what I've been trying:
>     <sequence name="sendJMSKoList">
>     	<send>
>     	   <endpoint>
>     	     <address  
> uri="jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactory&amp;transport.jms.DestinationType=queue"/>
>     	   </endpoint>
>     	</send>
>     </sequence>
>   
Why do you have 
..transport.jms.ConnectionFactory=cn=outgoingQueueFactory... ? i.e. why 
=cn=..?
> In axis2.xml, this is what the jmssender looks like:
>         <parameter name="outgoingQueueFactory">
>             <parameter
> name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</parameter>
>             <parameter
> name="java.naming.provider.url">ldap://servicelayer-dev:389/o=imq</parameter>
>             <parameter
> name="transport.jms.ConnectionFactoryJNDIName">cn=marklogicXCF</parameter>
>         </parameter>
>
>
> This is the error I get:
> ERROR JMSOutTransportInfo Cannot locate destination : cn=testQueue using
> jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactory&transport.jms.DestinationType=queue
> javax.naming.NoInitialContextException: Need to specify class name in
> environment or system property, or as an applet parameter, or in an
> application resource 
>   
Have you placed the JAR containing LdapCtxFactory (and any of its 
dependencies) into the lib directory?

Please share the full synapse.xml, axis2.xml and the log files

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: SNAPSHOT JMS publisher

Posted by kbohnenberger <ke...@mantech.com>.
This is what I've been trying:
    <sequence name="sendJMSKoList">
    	<send>
    	   <endpoint>
    	     <address  
uri="jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactory&amp;transport.jms.DestinationType=queue"/>
    	   </endpoint>
    	</send>
    </sequence>

In axis2.xml, this is what the jmssender looks like:
        <parameter name="outgoingQueueFactory">
            <parameter
name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</parameter>
            <parameter
name="java.naming.provider.url">ldap://servicelayer-dev:389/o=imq</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">cn=marklogicXCF</parameter>
        </parameter>


This is the error I get:
ERROR JMSOutTransportInfo Cannot locate destination : cn=testQueue using
jms:/cn=testQueue?transport.jms.ConnectionFactory=cn=outgoingQueueFactory&transport.jms.DestinationType=queue
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource 






kbohnenberger wrote:
> 
> I'm looking at
> http://people.apache.org/~veithen/synapse/Synapse_Samples.html#Sample250
> to create a jms publisher.
> I have it "working" with the long uri in the address that sets all the
> connection params locally in the sequence like this:
>     <sequence name="sendJMSKoList">
>     	<send>
>     	   <endpoint>
>               <address
> uri="jms:/cn=keithQueue1?transport.jms.ConnectionFactoryJNDIName=cn=marklogicXCF&amp;java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory&amp;java.naming.provider.url=ldap://servicelayer-dev:389/o=imq&amp;transport.jms.DestinationType=queue"/>    	         
>     	   </endpoint>
>     	</send>
>     </sequence>
> 
> 
> However, after this runs for a while I start getting connection
> exceptions.   It seems like this is creating a new connection every time
> it publishes.
> 
> Can I configure the address to point to the connection factory that I have
> in the axis2.xml file?
> If so, what is the syntax?  I tried "guessing" but couldn't get it to
> work.
> 
> 
> Thanks
> 
> Keith
> 

-- 
View this message in context: http://www.nabble.com/SNAPSHOT-JMS-publisher-tp22951348p22954129.html
Sent from the Synapse - User mailing list archive at Nabble.com.