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/13 21:18:35 UTC

passing params to a spring mediator

Can anyone point me to an example of how to pass parameters to a spring
mediator?
I realize I can pass them in via the spring context file but in some cases,
I need to pass them in from the synapse.xml file.

Thanks,

Keith
-- 
View this message in context: http://www.nabble.com/passing-params-to-a-spring-mediator-tp23027104p23027104.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: passing params to a spring mediator

Posted by kbohnenberger <ke...@mantech.com>.
Sorry, I forgot to add that I'm using a SNAPSHOT build from a couple weeks
ago.

My sequence looks like this:
	<sequence name="customSendJMSKoList">
    	<spring:spring bean="jmsQueuePublisher" key="jmsPublisherContext"   
xmlns:spring="http://ws.apache.org/ns/synapse/spring"/>
	</sequence>	




kbohnenberger wrote:
> 
> Can anyone point me to an example of how to pass parameters to a spring
> mediator?
> I realize I can pass them in via the spring context file but in some
> cases, I need to pass them in from the synapse.xml file.
> 
> Thanks,
> 
> Keith
> 

-- 
View this message in context: http://www.nabble.com/passing-params-to-a-spring-mediator-tp23027104p23027106.html
Sent from the Synapse - User mailing list archive at Nabble.com.


Re: passing params to a spring mediator

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

I did the test with sample 250 and there is indeed an issue. However,
I don't get any connection exceptions, but run into issue SYNAPSE-527
(basically, Synapse creates too many threads). Can you please

- test the workaround proposed in SYNAPSE-527, i.e. add the following
mediator before <send>:

<property action="remove" name="transportNonBlocking" scope="axis2"/>

- post the connection exception you are getting?

Regards,

Andreas

On Mon, Apr 13, 2009 at 23:35, Keith Bohnenberger
<ke...@mantech.com> wrote:
> Yes I will try to add a JIRA ticket.
> In general, this type of thing:
> <send>
> <endpoint>
>  <address
> uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=Qu
> eueConnectionFactory&amp;
> java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextF
> actory&amp;java.naming.provider.url=tcp://localhost:61616"/>
> </endpoint>
> </send>
>
> Seems to be making a JNDI lookup to get the connection factory for every
> message sent.  Eventually I start getting jndi connection exceptions (like,
> I said, after about 1000 messages or so)
>
> In my world, messages come in via a jms queue.  Messages can get published
> at a rate of about 25K a minute.
>
> In the ESB, messages get pulled off, some steps happen to validate, filter,
> transform and then messages get published to specific queues for our
> "subscribers"
>
> You can probably duplicate this problem by starting with sample 250 but
> instead of "switching" to an http call, "switch" to publishing to a
> different JMS queue.
> Load up the "incoming queue" with about 10000 messages.
> Start the ESB with your "switch from an incoming queue to an outgoing queue"
> sequence deployed and I'm guessing you'll get the same error as I'm getting
> after 1000 or so messages get pulled off of your incoming queue.
>
>
> Keith
>
>
>
> On 4/13/09 5:15 PM, "Asankha C. Perera" <as...@apache.org> wrote:
>
>> Hi Keith
>>> I wrote a spring based "jms publisher" because I could not use the synapse
>>> jms publishing because it seems to create a connection for every message
>>> sent, which runs into issues after about 1000 messages or so.
>>>
>> Can you raise a JIRA, and include all information.. if there is a known
>> bug we should fix it soon.. and your support would be helpful
>>
>> 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: passing params to a spring mediator

Posted by Keith Bohnenberger <ke...@mantech.com>.
Yes I will try to add a JIRA ticket.
In general, this type of thing:
<send>
<endpoint>
  <address 
uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=Qu
eueConnectionFactory&amp;
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextF
actory&amp;java.naming.provider.url=tcp://localhost:61616"/>
</endpoint>
</send>

Seems to be making a JNDI lookup to get the connection factory for every
message sent.  Eventually I start getting jndi connection exceptions (like,
I said, after about 1000 messages or so)

In my world, messages come in via a jms queue.  Messages can get published
at a rate of about 25K a minute.

In the ESB, messages get pulled off, some steps happen to validate, filter,
transform and then messages get published to specific queues for our
"subscribers"

You can probably duplicate this problem by starting with sample 250 but
instead of "switching" to an http call, "switch" to publishing to a
different JMS queue.
Load up the "incoming queue" with about 10000 messages.
Start the ESB with your "switch from an incoming queue to an outgoing queue"
sequence deployed and I'm guessing you'll get the same error as I'm getting
after 1000 or so messages get pulled off of your incoming queue.


Keith



On 4/13/09 5:15 PM, "Asankha C. Perera" <as...@apache.org> wrote:

> Hi Keith
>> I wrote a spring based "jms publisher" because I could not use the synapse
>> jms publishing because it seems to create a connection for every message
>> sent, which runs into issues after about 1000 messages or so.
>>   
> Can you raise a JIRA, and include all information.. if there is a known
> bug we should fix it soon.. and your support would be helpful
> 
> 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: passing params to a spring mediator

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Keith
> I wrote a spring based "jms publisher" because I could not use the synapse
> jms publishing because it seems to create a connection for every message
> sent, which runs into issues after about 1000 messages or so.
>   
Can you raise a JIRA, and include all information.. if there is a known 
bug we should fix it soon.. and your support would be helpful

cheers
asankha

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

http://esbmagic.blogspot.com





Re: passing params to a spring mediator

Posted by Keith Bohnenberger <ke...@mantech.com>.
SNAPSHOT buid ...

I wrote a spring based "jms publisher" because I could not use the synapse
jms publishing because it seems to create a connection for every message
sent, which runs into issues after about 1000 messages or so.

My custom JMS publisher needs to send to different queues depending on the
"sequence flow" in synapse.
Once it gets to the actual publishing step, the only real difference between
the specific sequences is the "destination."
I was hoping I could use the same spring bean for each specific sequence and
pass the specific destination in for each specific sequence.

I guess I can create different beans in the spring context file.  One for
each specific destination.



On 4/13/09 4:27 PM, "Andreas Veithen" <an...@gmail.com> wrote:

> Keith,
> 
> This is currently not supported. What is the use case for this?
> 
> Andreas
> 
> On Mon, Apr 13, 2009 at 21:18, kbohnenberger
> <ke...@mantech.com> wrote:
>> 
>> Can anyone point me to an example of how to pass parameters to a spring
>> mediator?
>> I realize I can pass them in via the spring context file but in some cases,
>> I need to pass them in from the synapse.xml file.
>> 
>> Thanks,
>> 
>> Keith
>> --
>> View this message in context:
>> http://www.nabble.com/passing-params-to-a-spring-mediator-tp23027104p23027104
>> .html
>> Sent from the Synapse - User mailing list archive at Nabble.com.
>> 
>> 

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: passing params to a spring mediator

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

This is currently not supported. What is the use case for this?

Andreas

On Mon, Apr 13, 2009 at 21:18, kbohnenberger
<ke...@mantech.com> wrote:
>
> Can anyone point me to an example of how to pass parameters to a spring
> mediator?
> I realize I can pass them in via the spring context file but in some cases,
> I need to pass them in from the synapse.xml file.
>
> Thanks,
>
> Keith
> --
> View this message in context: http://www.nabble.com/passing-params-to-a-spring-mediator-tp23027104p23027104.html
> Sent from the Synapse - User mailing list archive at Nabble.com.
>
>