Re: Camel 1.6/2.0 MINA UDP issue

2009-04-23 Thread albiii


Hi Claus :

 I am working with Orton and have a UDP Mutlicast question that is also a
general Camel Question.
We have a multihomed computer and would like to listen on a multicast group. 
Is there a way to specify the localhost nic (eth1 or eth0) in the Camel
From() to ensure we are listening on the correct network ?
I looked at the camel:mina options and didn't see an option for interface.  
http://camel.apache.org/mina.html

I looked at the MINA createDatagramEndpoint and didn't see where is is being
passed inI might be missing something.

1.  Just wanted to check with you to confirm, that the feature does not
currently exist.
2.  I checked the roadmap and this feature does not seem to be on it that I
can tell.  Is it hidden somewhere inside another feature request that I
don't know about ?
3.  It seems like the ability to specify the network interface card to
specify the network to listen on would be a natural fit in Camel  Mina, do
you concur ?
-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p23201393.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-26 Thread Claus Ibsen
On Thu, Mar 26, 2009 at 3:10 AM, orton o_hu...@yahoo.com wrote:

 Hi Claus,

 Some of my co-workers have been trying to use the 1.6.1 MINA component and
 had some of the same issues as we had with 2.0 with regards to the component
 stopping after some number of consecutive messages. I was wondering (hoping)
 if the fix would be applied to 1.6.1 also?

 I just pulled 1.6.1 off the 1.x branch and it didn't appear to have the
 fix...
Hi

Can you try again. I have just committed a fix on the 1.6.1 also. And
please report back if it works.


 Thanks!

 -

 Hi

 Just for the good sake. We have identified an issue and fixed it in
 camel-mina on trunk.

 Thanks to Orton for providing a sample case that surfaced the issue.
 Now it works like a charm and doesnt stall using UDP.


 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22714860.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-12 Thread Claus Ibsen
Hi

Just for the good sake. We have identified an issue and fixed it in
camel-mina on trunk.

Thanks to Orton for providing a sample case that surfaced the issue.
Now it works like a charm and doesnt stall using UDP.


On Wed, Mar 11, 2009 at 10:05 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Can you create a zip with a sample project that demonstrates this issue?
 I would like to take a look.

 Its interresting that creating a new producer once in a while resolves
 it. eg you get a brand new MINA session to work with.


 On Tue, Mar 10, 2009 at 8:01 PM, orton o_hu...@yahoo.com wrote:

 One more thing...

 Right now, I'm just catching all Exceptions and printing them out. When the
 component stops sending, usually no exceptions are thrown... Not sure if
 they are getting swallowed up somewhere lower.

 However, one time I ran it, for some reason I did get this:

 Exception caught: Could not write body on the exchange: Exchange[Message:
 [Publisher]: Test Body Message: 34535]
 org.apache.camel.CamelExchangeException: Could not write body on the
 exchange: Exchange[Message: [Publisher]: Test Body Message: 34535]
                                         at
 org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47)
                                         at
 org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
                                         at
 edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
                                         at
 edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:84)
 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22441278.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/




-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-12 Thread Claus Ibsen
On Thu, Mar 12, 2009 at 5:31 PM, orton o_hu...@yahoo.com wrote:

 Hi Again,

 Thanks Claus for the fix! That resolved the issue I was having with the MINA
 sender and I can run it a lot longer.

 Unfortunately :( however, I get this problem now after many more messages:

 Messages Sent: [Publisher]: Test Body Message: 2366999
 Messages Sent: [Publisher]: Test Body Message: 2367999
 Messages Sent: [Publisher]: Test Body Message: 2368999
 Exception caught: Cannot write body on the exchange: Exchange[Message:
 [Publisher]: Test Body Message: 2369836]
 org.apache.camel.CamelExchangeException: Cannot write body on the exchange:
 Exchange[Message: [Publisher]: Test Body Message: 2369836]
        at 
 org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:52)
        at
 org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
        at
 edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
        at edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:133)

 In this case, I'm sending 30 Byte messages one after another as fast as I
 can and it gets to 2.3 million messages or so. I'm not sure if I'm running
 out of memory (perhaps the garbage collection is cleaning up things fast
 enough)?

 Thoughts? Thanks again!
You should just catch the exception and continue with sending. It
should be able to send the rest.
Eg you can do a retry to send it again.

You are using UDP so the QoS is not as high as TCP.




 Claus Ibsen-2 wrote:

 Hi

 Just for the good sake. We have identified an issue and fixed it in
 camel-mina on trunk.

 Thanks to Orton for providing a sample case that surfaced the issue.
 Now it works like a charm and doesnt stall using UDP.


 On Wed, Mar 11, 2009 at 10:05 AM, Claus Ibsen claus.ib...@gmail.com
 wrote:
 Hi

 Can you create a zip with a sample project that demonstrates this issue?
 I would like to take a look.

 Its interresting that creating a new producer once in a while resolves
 it. eg you get a brand new MINA session to work with.


 On Tue, Mar 10, 2009 at 8:01 PM, orton o_hu...@yahoo.com wrote:

 One more thing...

 Right now, I'm just catching all Exceptions and printing them out. When
 the
 component stops sending, usually no exceptions are thrown... Not sure if
 they are getting swallowed up somewhere lower.

 However, one time I ran it, for some reason I did get this:

 Exception caught: Could not write body on the exchange:
 Exchange[Message:
 [Publisher]: Test Body Message: 34535]
 org.apache.camel.CamelExchangeException: Could not write body on the
 exchange: Exchange[Message: [Publisher]: Test Body Message: 34535]
                                         at
 org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47)
                                         at
 org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
                                         at
 edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
                                         at
 edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:84)
 --
 View this message in context:
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22441278.html
 Sent from the Camel - Development (activemq) mailing list archive at
 Nabble.com.





 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/




 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/



 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22479515.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread Claus Ibsen
On Tue, Mar 10, 2009 at 2:39 AM, orton o_hu...@yahoo.com wrote:

 Hi,

 I've been trying to use the MINA component for UDP data delivery but have
 been having some issues and was wondering if anyone else has seen this
 error.

 I'm sending small packets (100Bytes) as fast as I can (sequentially from a
 single client) but after around 35,000 packets sent, the Camel client
 abruptly stops without any errors/exceptions. I first tried this with the
 1.6 release and saw this problem and recently downloaded and compiled the
 2.0 core and components but still have the same issue. When I use MINA with
 TCP, I don't have this problem...

 Here's what I have for code:
 -

        public void init( String serverIP, int serverPort ) {
                uri = mina:udp:// + serverIP + : + serverPort + 
 ?sync=false;
                System.out.println(Camel URI:  + uri);
        }

        public void sendMessages(int numOfMessages, int messageSize) throws
 Exception {

                CamelContext context = new DefaultCamelContext();
                context.start();

                Endpoint endpoint = context.getEndpoint(uri);
                Exchange exchange =
 endpoint.createExchange(ExchangePattern.InOnly);
                Producer producer = endpoint.createProducer();
                producer.start();

                for (int i = 0; i  numOfMessages; i++) {
                        String s = [Publisher]: Test Body Message:  + i;
                        exchange.getIn().setBody(s);
                        producer.process(exchange);
                }
            producer.stop();
        }


 I looked through various forums and saw some memory leak issues, but wasn't
 sure if this is related?

 If anyone can help, would be much appreciated!!
What version of Camel and Mina are you using?

Mina is in the works of doing a Mina 2.0 that might be much better.
When its release we will upgrade it in Camel 2.0 as well.

Yes the memory leaks is interresting? Where did you find them?

And whats the relevanse of you test? Sending 65.000 udp packages to yourself?
Are you using Camel to be the Mina server as well? Or do you send it
to another JVM?

Using TCP that works. Are you using the exact same sample but just
change udp to tcp in the endpoint URI?




 Orton
 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22426433.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread Claus Ibsen
Hi

I have commited a fix to UPD in camel-mina on both 1.6.1 and 2.0
https://issues.apache.org/activemq/browse/CAMEL-1444

Could you try it out on your system?

2.0-SNAPSHOT is automatic build and published at apache maven snapshot repo.
http://camel.apache.org/download.html

I cant remember if 1.6.1-SNAPSHOT also is, it kinda got lost on in TLP
move recently.



On Tue, Mar 10, 2009 at 11:24 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 BTW I think I have seen some UDP issue with camel-mina about
 acquiring/releasing mina byte buffer.
 Damm that API is not so easy to work with - should be improved in mina 2.0

 So it could relate to your issue as well

 On Tue, Mar 10, 2009 at 8:43 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 On Tue, Mar 10, 2009 at 2:39 AM, orton o_hu...@yahoo.com wrote:

 Hi,

 I've been trying to use the MINA component for UDP data delivery but have
 been having some issues and was wondering if anyone else has seen this
 error.

 I'm sending small packets (100Bytes) as fast as I can (sequentially from a
 single client) but after around 35,000 packets sent, the Camel client
 abruptly stops without any errors/exceptions. I first tried this with the
 1.6 release and saw this problem and recently downloaded and compiled the
 2.0 core and components but still have the same issue. When I use MINA with
 TCP, I don't have this problem...

 Here's what I have for code:
 -

        public void init( String serverIP, int serverPort ) {
                uri = mina:udp:// + serverIP + : + serverPort + 
 ?sync=false;
                System.out.println(Camel URI:  + uri);
        }

        public void sendMessages(int numOfMessages, int messageSize) throws
 Exception {

                CamelContext context = new DefaultCamelContext();
                context.start();

                Endpoint endpoint = context.getEndpoint(uri);
                Exchange exchange =
 endpoint.createExchange(ExchangePattern.InOnly);
                Producer producer = endpoint.createProducer();
                producer.start();

                for (int i = 0; i  numOfMessages; i++) {
                        String s = [Publisher]: Test Body Message:  + i;
                        exchange.getIn().setBody(s);
                        producer.process(exchange);
                }
            producer.stop();
        }


 I looked through various forums and saw some memory leak issues, but wasn't
 sure if this is related?

 If anyone can help, would be much appreciated!!
 What version of Camel and Mina are you using?

 Mina is in the works of doing a Mina 2.0 that might be much better.
 When its release we will upgrade it in Camel 2.0 as well.

 Yes the memory leaks is interresting? Where did you find them?

 And whats the relevanse of you test? Sending 65.000 udp packages to yourself?
 Are you using Camel to be the Mina server as well? Or do you send it
 to another JVM?

 Using TCP that works. Are you using the exact same sample but just
 change udp to tcp in the endpoint URI?




 Orton
 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22426433.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/




 --
 Claus Ibsen
 Apache Camel Committer

 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/




-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton

 What version of Camel and Mina are you using?

I tried it out on the Camel 1.6 bin release and I compiled the Camel 2.0
snapshot in svn and both appeared to have the same problem... mina-core for
both appear to be 1.1.7

 Mina is in the works of doing a Mina 2.0 that might be much better.
 When its release we will upgrade it in Camel 2.0 as well.

 Yes the memory leaks is interresting? Where did you find them?

I only saw some references in past forums and some of my co-workers have
mentioned them to me also, will look for more details and send to you

 And whats the relevanse of you test? Sending 65.000 udp packages to
 yourself?
 Are you using Camel to be the Mina server as well? Or do you send it
 to another JVM?

We're trying to do some simple stress and overhead testing on the Camel
components... We really like what you guys have done with it and find the
patterns extremely useful. We want to see how suitable it is for
applications with high throughput, low latency needs and what the extra cost
for using Camel is. I have separate servers in different VM's but on the
same host for now. 


 Using TCP that works. Are you using the exact same sample but just
 change udp to tcp in the endpoint URI?

I send the exact same samples with UDP and TCP... Just tried the multicast
one and it gives me the same issue as the UDP one...


-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22434032.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread Claus Ibsen
On Tue, Mar 10, 2009 at 2:19 PM, orton o_hu...@yahoo.com wrote:

 What version of Camel and Mina are you using?

 I tried it out on the Camel 1.6 bin release and I compiled the Camel 2.0
 snapshot in svn and both appeared to have the same problem... mina-core for
 both appear to be 1.1.7

 Mina is in the works of doing a Mina 2.0 that might be much better.
 When its release we will upgrade it in Camel 2.0 as well.

 Yes the memory leaks is interresting? Where did you find them?

 I only saw some references in past forums and some of my co-workers have
 mentioned them to me also, will look for more details and send to you

 And whats the relevanse of you test? Sending 65.000 udp packages to
 yourself?
 Are you using Camel to be the Mina server as well? Or do you send it
 to another JVM?

 We're trying to do some simple stress and overhead testing on the Camel
 components... We really like what you guys have done with it and find the
 patterns extremely useful. We want to see how suitable it is for
 applications with high throughput, low latency needs and what the extra cost
 for using Camel is. I have separate servers in different VM's but on the
 same host for now.


 Using TCP that works. Are you using the exact same sample but just
 change udp to tcp in the endpoint URI?

 I send the exact same samples with UDP and TCP... Just tried the multicast
 one and it gives me the same issue as the UDP one...
Thanks for the info.

Have you seen my mails about commit a fix? Could you try again with a
version of Camel that has the fix build.

The problem would probably not manifest itself if you use 2 separate
JVM's - 1 for server, 1 for client





 --
 View this message in context: 
 http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22434032.html
 Sent from the Camel - Development (activemq) mailing list archive at 
 Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton


≥Oh if you do NOT use the transferExchange=true option. eg if you send
≥regular payload with Camel 1.6.0.

≥But yet again would be nice if you try the comitted fix.

Hi Claus, am updating my Camel 2.0 code from repository and compiling now.

Can you explain the transferExchange comment some more? Sorry, still a
little new to Camel and not sure how that option affects things?

Thanks again!!

-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22434468.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton


It marshal the entire Exchange, eg the container object in Camel used
when routing messages.
Its an option to use MINA as a kind of bridge between camel instances.
So you can keep headers, properties etc. when you send the Exchange
using Mina.
Normally you only send the payload itself, eg the Body.

So when the Exchange is assembled on the other side it could contain
stuff mina there could get confused over. But I really doubt it.

I put my rely on the fix.

But could you test with transferExchange=true and again with it =false

Hi Claus,

So I retrieved the latest Camel 2.0 MINA code and re-compiled.
Unfortunately, I still see the same problem for UDP :(

The transferExchange appears only relevant to TCP? When I set it to true
for UDP, it throws an IllegalArgumentException (not supported for Datagram
Protocol). Setting it to false does not appear to change anything (still
failing)

Having the UDP server endpoint on a different machine entirely also did not
affect anything...

I'm not sure if this may help you debug, but if I reset the producer:
 producer = endpoint.createProducer();
 producer.start();
every thousand or so sends, then i can keep sending (tested it up to a
million packets and it doesn't stop)







-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22439406.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.



Re: Camel 1.6/2.0 MINA UDP issue

2009-03-10 Thread orton

One more thing... 

Right now, I'm just catching all Exceptions and printing them out. When the
component stops sending, usually no exceptions are thrown... Not sure if
they are getting swallowed up somewhere lower.

However, one time I ran it, for some reason I did get this:

Exception caught: Could not write body on the exchange: Exchange[Message:
[Publisher]: Test Body Message: 34535]
org.apache.camel.CamelExchangeException: Could not write body on the
exchange: Exchange[Message: [Publisher]: Test Body Message: 34535]
 at
org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47)
 at
org.apache.camel.component.mina.MinaProducer.process(MinaProducer.java:99)
 at
edu.mit.ll.test.clients.UDPCamelClient.sendMessages(UDPCamelClient.java:70)
 at
edu.mit.ll.test.clients.UDPCamelClient.main(UDPCamelClient.java:84)
-- 
View this message in context: 
http://www.nabble.com/Camel-1.6-2.0-MINA-UDP-issue-tp22426433p22441278.html
Sent from the Camel - Development (activemq) mailing list archive at Nabble.com.