You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jeff V <Je...@Ultra-UEMS.com> on 2008/11/05 20:26:59 UTC

Usage of Mina in camelContext for TCP loop.

Hi,

I am trying to setup a simple demo of activemq and mina. I edited the
camelContext in the activemq.xml file to include two mina tcp sockets, two
queues and routes as such:

listenerA -> qA -> listenerB
listenerB -> qB -> listenerA

The intent is to have two way pass through between two telnet sessions.
Later, I will add more fancy features such as filtering, routing to a topic
and my own codec on each listener.

Here is my camelcontext:
    <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">

        <!-- You can use a <package> element for each root package to search
for Java routes -->
        <package>com.myco.codec</package>

        <endpoint id="listener_A"
uri="mina:tcp://localhost:42000?textline=true"/>
		<endpoint id="listener_B" uri="mina:tcp://localhost:42001?textline=true"/>
		
		<!-- You can use Spring XML syntax to define the routes here using the
<route> element -->
        <route>
            <from ref="listener_A"/>
            <to uri="activemq:qA"/>
        </route>
        <route>
            <from uri="activemq:qB"/>
            <to ref="listener_A"/>
        </route>
        <route>
            <from ref="listener_B"/>
            <to uri="activemq:qB"/>
        </route>
        <route>
            <from uri="activemq:qA"/>
            <to ref="listener_B"/>
        </route>
    </camelContext>

When I start activemq I get an exception:

org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
mina:tcp://localhost:42000?textline=true

Do I explicitly need to add a mina bean? If so where and how?
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20348095.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
Thanks Claus,

The service I am connecting to is a TCP server mode socket that has two
modes of communication:

1) Request / Response
AMQ: <Request><ParameterQuery param="temperature" /></Request>
DEV:  <Response><QueryResult param="temperature" value="22.5"/></Response>

2) unsolicited events
DEV:  <Event><ParameterAlarm param="temperature" value="30.1" desc="high
temperature"/></Event>

In my slightly contrived example, AMQ is the ActiveMQ generating / routing
requests and DEV represents a device connected to the TCP port responding to
requests and generating event messages.

I would like two way async communications such that my update messages can
flow into AMQ and be routed to topic subscribers, logs, persistent storage,
email etc..

I do not need the request response to a camel exchange, I will handle that
at a higher level.
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20397359.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

If your application starts by sending to tcpA and you want to wait for a response (in your application), then you should set sync=true as an option on the tcpA URI. Where as sync in this case means in-out. If sync=false then it's like in-only (fire and forget).

message in -> tcpA->qA->tcpB -> message out

message in -> tcpB->qB->tcpA -> message out

Is not possible as the 1st tcpA and the last tcpA is not the same, so to speak.

What you can do is:

Application -> tcpA->qA->tcpB->qB : And the reply to Application is the OUT message from the exchange at qB.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 7. november 2008 16:19
To: camel-user@activemq.apache.org
Subject: RE: Usage of Mina in camelContext for TCP loop.


I am still having problems getting a tcp connection to relay messages
outbound. I can connect to the defined TCP socket, however any messages sent
to a queue routed to the tcp connection are not getting received by my
application.

Do you know if the tcp connection is bidirectional like this once the
connection is established?

I need this to be bidirectional but not synchronous.

        <endpoint id="tcpA"
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
		<endpoint id="tcpB"
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
		
		<!-- You can use Spring XML syntax to define the routes here using the
<route> element -->

        <route>
            <from ref="tcpA"/>
            <to uri="activemq:qA"/>
        </route>

        <route>
            <from ref="tcpB"/>
            <to uri="activemq:qB"/>
        </route>

        <route>
            <from uri="activemq:qA"/>
            <to ref="tcpB"/>
        </route>

        <route>
            <from uri="activemq:qB"/>
            <to ref="tcpA"/>
        </route>

Note this code generated a large number of messages to qB, so there must be
a loop happening here. I was expecting a bidirectional flow from tcpA to
tcpB routed through qA and qB depending on direction of flow:

message in -> tcpA->qA->tcpB -> message out

message in -> tcpB->qB->tcpA -> message out


Claus Ibsen wrote:
> 
> Hi
> 
> Glad you got it working. Learning Camel is very mich learn by doing, as
> its so quick to get running that most people jump in right away. No need
> to read a 200 pages .pdf to start ;)
> 
> So please continue to post questions or issues, that is why we have this
> vibrant community to help.
> 
> 
> 
> These 'errors' is logged at DEBUG level while Camel is loading the type
> converters based on classpath scanning the .jars.
> 
> You can basically ignore this, or if you want to remedy it, you can add or
> remove needed .jars.
> 
> For instance you have this -test jar on the classpath
> Loading from jar: C:\Program
> Files\apache-activemq-5.1.0\bin\win32\..\..\lib\activemq-core-5.1.0-tests.jar
> 
> That depends on the camel -test jars as well. So you could add this .jar
> camel-core-1.4.0-tests.jar
> 
> The -tests .jars is used as support classes for unit testing. So if you
> don't use unit testing then you could remove all the -tests .jars all
> together.
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
> Sent: 6. november 2008 21:43
> To: camel-user@activemq.apache.org
> Subject: RE: Usage of Mina in camelContext for TCP loop.
> 
> 
> I appreciate your patience Claus.
> 
> I changed that to use the full uri in my routes:
> 
>         <route>
>             <from
> uri="mina:tcp://localhost:42000?textline=true&amp;sync=false"/>
>             <to uri="activemq:qA"/>
>         </route>
> 
>         <route>
>             <from uri="activemq:qA"/>
>             <to
> uri="mina:tcp://localhost:42001?textline=true&amp;sync=false"/>
>         </route>
> 
> This cause some exception explosions in my logs:
> http://www.nabble.com/file/p20369255/activemq.log activemq.log 
> 
> However, it seems I now have a tcp socket. That is accepting text lines.
> Sweet!!!
> -- 
> View this message in context:
> http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20369255.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20382571.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
I am still having problems getting a tcp connection to relay messages
outbound. I can connect to the defined TCP socket, however any messages sent
to a queue routed to the tcp connection are not getting received by my
application.

Do you know if the tcp connection is bidirectional like this once the
connection is established?

I need this to be bidirectional but not synchronous.

        <endpoint id="tcpA"
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
		<endpoint id="tcpB"
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
		
		<!-- You can use Spring XML syntax to define the routes here using the
<route> element -->

        <route>
            <from ref="tcpA"/>
            <to uri="activemq:qA"/>
        </route>

        <route>
            <from ref="tcpB"/>
            <to uri="activemq:qB"/>
        </route>

        <route>
            <from uri="activemq:qA"/>
            <to ref="tcpB"/>
        </route>

        <route>
            <from uri="activemq:qB"/>
            <to ref="tcpA"/>
        </route>

Note this code generated a large number of messages to qB, so there must be
a loop happening here. I was expecting a bidirectional flow from tcpA to
tcpB routed through qA and qB depending on direction of flow:

message in -> tcpA->qA->tcpB -> message out

message in -> tcpB->qB->tcpA -> message out


Claus Ibsen wrote:
> 
> Hi
> 
> Glad you got it working. Learning Camel is very mich learn by doing, as
> its so quick to get running that most people jump in right away. No need
> to read a 200 pages .pdf to start ;)
> 
> So please continue to post questions or issues, that is why we have this
> vibrant community to help.
> 
> 
> 
> These 'errors' is logged at DEBUG level while Camel is loading the type
> converters based on classpath scanning the .jars.
> 
> You can basically ignore this, or if you want to remedy it, you can add or
> remove needed .jars.
> 
> For instance you have this -test jar on the classpath
> Loading from jar: C:\Program
> Files\apache-activemq-5.1.0\bin\win32\..\..\lib\activemq-core-5.1.0-tests.jar
> 
> That depends on the camel -test jars as well. So you could add this .jar
> camel-core-1.4.0-tests.jar
> 
> The -tests .jars is used as support classes for unit testing. So if you
> don't use unit testing then you could remove all the -tests .jars all
> together.
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
> Sent: 6. november 2008 21:43
> To: camel-user@activemq.apache.org
> Subject: RE: Usage of Mina in camelContext for TCP loop.
> 
> 
> I appreciate your patience Claus.
> 
> I changed that to use the full uri in my routes:
> 
>         <route>
>             <from
> uri="mina:tcp://localhost:42000?textline=true&amp;sync=false"/>
>             <to uri="activemq:qA"/>
>         </route>
> 
>         <route>
>             <from uri="activemq:qA"/>
>             <to
> uri="mina:tcp://localhost:42001?textline=true&amp;sync=false"/>
>         </route>
> 
> This cause some exception explosions in my logs:
> http://www.nabble.com/file/p20369255/activemq.log activemq.log 
> 
> However, it seems I now have a tcp socket. That is accepting text lines.
> Sweet!!!
> -- 
> View this message in context:
> http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20369255.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20382571.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Glad you got it working. Learning Camel is very mich learn by doing, as its so quick to get running that most people jump in right away. No need to read a 200 pages .pdf to start ;)

So please continue to post questions or issues, that is why we have this vibrant community to help.



These 'errors' is logged at DEBUG level while Camel is loading the type converters based on classpath scanning the .jars.

You can basically ignore this, or if you want to remedy it, you can add or remove needed .jars.

For instance you have this -test jar on the classpath
Loading from jar: C:\Program Files\apache-activemq-5.1.0\bin\win32\..\..\lib\activemq-core-5.1.0-tests.jar

That depends on the camel -test jars as well. So you could add this .jar
camel-core-1.4.0-tests.jar

The -tests .jars is used as support classes for unit testing. So if you don't use unit testing then you could remove all the -tests .jars all together.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 6. november 2008 21:43
To: camel-user@activemq.apache.org
Subject: RE: Usage of Mina in camelContext for TCP loop.


I appreciate your patience Claus.

I changed that to use the full uri in my routes:

        <route>
            <from
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false"/>
            <to uri="activemq:qA"/>
        </route>

        <route>
            <from uri="activemq:qA"/>
            <to
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false"/>
        </route>

This cause some exception explosions in my logs:
http://www.nabble.com/file/p20369255/activemq.log activemq.log 

However, it seems I now have a tcp socket. That is accepting text lines.
Sweet!!!
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20369255.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
I appreciate your patience Claus.

I changed that to use the full uri in my routes:

        <route>
            <from
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false"/>
            <to uri="activemq:qA"/>
        </route>

        <route>
            <from uri="activemq:qA"/>
            <to
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false"/>
        </route>

This cause some exception explosions in my logs:
http://www.nabble.com/file/p20369255/activemq.log activemq.log 

However, it seems I now have a tcp socket. That is accepting text lines.
Sweet!!!
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20369255.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Ah you should not prefix all the schemes with activemq. Activemq is only for the JMS queues. So this one below is wrong:
  <from uri="activemq:tcp_A"/>

It should just be without the activemq, and you should use the ref attribute, since you want to reference and id of an endpoint you have defined elsewhere in the XML:
    <from ref="tcp_A"/>


Or you can type the complete URI directly and use the uri attribute:
  <from uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 6. november 2008 21:04
To: camel-user@activemq.apache.org
Subject: RE: Usage of Mina in camelContext for TCP loop.


I have two mina related jars: 

mina-core-1.1.7.jar
camel-mina-1.4.0.jar

Are there others required?

I also have installed: 
slf4j-log4j12
slf4j-simple
spring-aop
spring-context


Claus Ibsen wrote:
> 
> Hi
> 
> I think Mina uses sl4j for logging, so you might need to add some of these
> .jars as well to get it to log.
> 
> You can also set the minalogger=true option on the URI to add more
> logging.
> http://activemq.apache.org/camel/mina.html
> 
> Are you sure you got all the needed jars by mina?
> 
> 
> Camel should log at INFO level when it starts the mina consumer that
> listen for incoming socket requests
> 
> Binding to server address: " + address + " using acceptor: " + acceptor
> 
> So you should get the log line above in your logs.
> 
> If there is still some issues then I can try create a XML route with mina
> to see if I get any problems.  
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
> Sent: 6. november 2008 16:14
> To: camel-user@activemq.apache.org
> Subject: Re: Usage of Mina in camelContext for TCP loop.
> 
> 
> Thanks James.
> 
> I have since move to camel 1.4 components, cleared my data folder. (great
> tip by the way, Claus)
> 
> However, I still cannot seem to get a mina:tcp socket listener working. I
> open "telnet localhost 42000" and no connection is established.
> 
> Does anyone have a working example of an XML defined mina:tcp socket?
> 
>     <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> 
>         <package>com.myco.codec</package>
> 
>         <endpoint id="tcp_A"
> uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
>         <endpoint id="tcp_B"
> uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
> 		
>         <route>
>             <from uri="activemq:tcp_A"/>
>             <to uri="activemq:qA"/>
>         </route>
>         <route>
>             <from uri="activemq:qA"/>
>             <to uri="activemq:tcp_B"/>
>         </route>
>     </camelContext>
> 
> Here is my log if it helps: 
> http://www.nabble.com/file/p20362961/activemq.log activemq.log 
> 
> I have camel logging set to DEBUG. Anyone know the mina log class? I
> tried:
> "log4j.logger.org.apache.mina". Doesn't seem to work.
> 
> Thanks again! I know this is getting arduous.
> 
> -- 
> View this message in context:
> http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20362961.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20368666.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
I have two mina related jars: 

mina-core-1.1.7.jar
camel-mina-1.4.0.jar

Are there others required?

I also have installed: 
slf4j-log4j12
slf4j-simple
spring-aop
spring-context


Claus Ibsen wrote:
> 
> Hi
> 
> I think Mina uses sl4j for logging, so you might need to add some of these
> .jars as well to get it to log.
> 
> You can also set the minalogger=true option on the URI to add more
> logging.
> http://activemq.apache.org/camel/mina.html
> 
> Are you sure you got all the needed jars by mina?
> 
> 
> Camel should log at INFO level when it starts the mina consumer that
> listen for incoming socket requests
> 
> Binding to server address: " + address + " using acceptor: " + acceptor
> 
> So you should get the log line above in your logs.
> 
> If there is still some issues then I can try create a XML route with mina
> to see if I get any problems.  
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
> Sent: 6. november 2008 16:14
> To: camel-user@activemq.apache.org
> Subject: Re: Usage of Mina in camelContext for TCP loop.
> 
> 
> Thanks James.
> 
> I have since move to camel 1.4 components, cleared my data folder. (great
> tip by the way, Claus)
> 
> However, I still cannot seem to get a mina:tcp socket listener working. I
> open "telnet localhost 42000" and no connection is established.
> 
> Does anyone have a working example of an XML defined mina:tcp socket?
> 
>     <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> 
>         <package>com.myco.codec</package>
> 
>         <endpoint id="tcp_A"
> uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
>         <endpoint id="tcp_B"
> uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
> 		
>         <route>
>             <from uri="activemq:tcp_A"/>
>             <to uri="activemq:qA"/>
>         </route>
>         <route>
>             <from uri="activemq:qA"/>
>             <to uri="activemq:tcp_B"/>
>         </route>
>     </camelContext>
> 
> Here is my log if it helps: 
> http://www.nabble.com/file/p20362961/activemq.log activemq.log 
> 
> I have camel logging set to DEBUG. Anyone know the mina log class? I
> tried:
> "log4j.logger.org.apache.mina". Doesn't seem to work.
> 
> Thanks again! I know this is getting arduous.
> 
> -- 
> View this message in context:
> http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20362961.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20368666.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

I think Mina uses sl4j for logging, so you might need to add some of these .jars as well to get it to log.

You can also set the minalogger=true option on the URI to add more logging.
http://activemq.apache.org/camel/mina.html

Are you sure you got all the needed jars by mina?


Camel should log at INFO level when it starts the mina consumer that listen for incoming socket requests

Binding to server address: " + address + " using acceptor: " + acceptor

So you should get the log line above in your logs.

If there is still some issues then I can try create a XML route with mina to see if I get any problems.  



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 6. november 2008 16:14
To: camel-user@activemq.apache.org
Subject: Re: Usage of Mina in camelContext for TCP loop.


Thanks James.

I have since move to camel 1.4 components, cleared my data folder. (great
tip by the way, Claus)

However, I still cannot seem to get a mina:tcp socket listener working. I
open "telnet localhost 42000" and no connection is established.

Does anyone have a working example of an XML defined mina:tcp socket?

    <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">

        <package>com.myco.codec</package>

        <endpoint id="tcp_A"
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
        <endpoint id="tcp_B"
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
		
        <route>
            <from uri="activemq:tcp_A"/>
            <to uri="activemq:qA"/>
        </route>
        <route>
            <from uri="activemq:qA"/>
            <to uri="activemq:tcp_B"/>
        </route>
    </camelContext>

Here is my log if it helps: 
http://www.nabble.com/file/p20362961/activemq.log activemq.log 

I have camel logging set to DEBUG. Anyone know the mina log class? I tried:
"log4j.logger.org.apache.mina". Doesn't seem to work.

Thanks again! I know this is getting arduous.

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20362961.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
Thanks James.

I have since move to camel 1.4 components, cleared my data folder. (great
tip by the way, Claus)

However, I still cannot seem to get a mina:tcp socket listener working. I
open "telnet localhost 42000" and no connection is established.

Does anyone have a working example of an XML defined mina:tcp socket?

    <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">

        <package>com.myco.codec</package>

        <endpoint id="tcp_A"
uri="mina:tcp://localhost:42000?textline=true&amp;sync=false" />
        <endpoint id="tcp_B"
uri="mina:tcp://localhost:42001?textline=true&amp;sync=false" />
		
        <route>
            <from uri="activemq:tcp_A"/>
            <to uri="activemq:qA"/>
        </route>
        <route>
            <from uri="activemq:qA"/>
            <to uri="activemq:tcp_B"/>
        </route>
    </camelContext>

Here is my log if it helps: 
http://www.nabble.com/file/p20362961/activemq.log activemq.log 

I have camel logging set to DEBUG. Anyone know the mina log class? I tried:
"log4j.logger.org.apache.mina". Doesn't seem to work.

Thanks again! I know this is getting arduous.

-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20362961.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Usage of Mina in camelContext for TCP loop.

Posted by James Strachan <ja...@gmail.com>.
2008/11/6 Jeff V <Je...@ultra-uems.com>:
>
> Thanks, Claus!
>
> Adding camel-mina-1.3.0.jar to my lib folder fixed it.
>
> I'm now on to another problem. Hopefully, close to getting it working.
>
> The new problem: my queues are filling up with exceptions:
> javax.el.PropertyNotFoundException: The class
> 'org.apache.activemq.web.MessageQuery' does not have the property
> 'JMSMessageID'.
> at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)

That looks like a bug in the web console -
'org.apache.activemq.web.MessageQuery' is used to implement the web
console. It shouldn't be used at all to create messages or be in the
body of messages


> How do I clear all queues and routes from activemq. I am trying to purge and
> delect in the web view but they are coming back and filling up again.

It could be something is filling them up?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

I am not at all a ActiveMQ expert but I do happen to know that it has a local data folder it uses for persistent store (if you don't state a DB etc. to use).

By default it is in ACTIVE_MQ_HOME\data

You might be able to swipe the data folder and thus get rid of all messages in any queues.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 6. november 2008 13:23
To: camel-user@activemq.apache.org
Subject: RE: Usage of Mina in camelContext for TCP loop.


Thanks, Claus!

Adding camel-mina-1.3.0.jar to my lib folder fixed it.

I'm now on to another problem. Hopefully, close to getting it working.

The new problem: my queues are filling up with exceptions: 
javax.el.PropertyNotFoundException: The class
'org.apache.activemq.web.MessageQuery' does not have the property
'JMSMessageID'.
at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)

Note sure if this is a cause or effect with the queues filling up.

How do I clear all queues and routes from activemq. I am trying to purge and
delect in the web view but they are coming back and filling up again.
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20360088.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Jeff V <Je...@Ultra-UEMS.com>.
Thanks, Claus!

Adding camel-mina-1.3.0.jar to my lib folder fixed it.

I'm now on to another problem. Hopefully, close to getting it working.

The new problem: my queues are filling up with exceptions: 
javax.el.PropertyNotFoundException: The class
'org.apache.activemq.web.MessageQuery' does not have the property
'JMSMessageID'.
at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)

Note sure if this is a cause or effect with the queues filling up.

How do I clear all queues and routes from activemq. I am trying to purge and
delect in the web view but they are coming back and filling up again.
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20360088.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Usage of Mina in camelContext for TCP loop.

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

It could be because of classpath issues.

You need camel-mina.jar on the classpath. And the related mina .jars as well. Maybe that is the problem.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Jeff V [mailto:Jeff.Vienneau@Ultra-UEMS.com] 
Sent: 5. november 2008 20:27
To: camel-user@activemq.apache.org
Subject: Usage of Mina in camelContext for TCP loop.


Hi,

I am trying to setup a simple demo of activemq and mina. I edited the
camelContext in the activemq.xml file to include two mina tcp sockets, two
queues and routes as such:

listenerA -> qA -> listenerB
listenerB -> qB -> listenerA

The intent is to have two way pass through between two telnet sessions.
Later, I will add more fancy features such as filtering, routing to a topic
and my own codec on each listener.

Here is my camelcontext:
    <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">

        <!-- You can use a <package> element for each root package to search
for Java routes -->
        <package>com.myco.codec</package>

        <endpoint id="listener_A"
uri="mina:tcp://localhost:42000?textline=true"/>
		<endpoint id="listener_B" uri="mina:tcp://localhost:42001?textline=true"/>
		
		<!-- You can use Spring XML syntax to define the routes here using the
<route> element -->
        <route>
            <from ref="listener_A"/>
            <to uri="activemq:qA"/>
        </route>
        <route>
            <from uri="activemq:qB"/>
            <to ref="listener_A"/>
        </route>
        <route>
            <from ref="listener_B"/>
            <to uri="activemq:qB"/>
        </route>
        <route>
            <from uri="activemq:qA"/>
            <to ref="listener_B"/>
        </route>
    </camelContext>

When I start activemq I get an exception:

org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
mina:tcp://localhost:42000?textline=true

Do I explicitly need to add a mina bean? If so where and how?
-- 
View this message in context: http://www.nabble.com/Usage-of-Mina-in-camelContext-for-TCP-loop.-tp20348095s22882p20348095.html
Sent from the Camel - Users mailing list archive at Nabble.com.