Re: Problem with FileConsumer and pollEnrich

2009-08-10 Thread akuhtz

Hi Claus,

FileUtil.stripExt(...) does not exist on trunk ... 
-- 
View this message in context: 
http://www.nabble.com/Problem-with-FileConsumer-and-pollEnrich-tp24795192p24895089.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Problem with FileConsumer and pollEnrich

2009-08-10 Thread Claus Ibsen
On Mon, Aug 10, 2009 at 8:52 AM, akuhtzandreas.ku...@siemens.com wrote:

 Hi Claus,

 FileUtil.stripExt(...) does not exist on trunk ...

Ah that is very easy for yourself to create such a method. Eg its just
there to change the filename to use .dat as extension.
Here is the code:

public static String stripExt(String name) {
if (name == null) {
return null;
}
int pos = name.lastIndexOf('.');
if (pos != -1) {
return name.substring(0, pos);
}
return name;
}



 --
 View this message in context: 
 http://www.nabble.com/Problem-with-FileConsumer-and-pollEnrich-tp24795192p24895089.html
 Sent from the Camel - Users 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: Problem with FileConsumer and pollEnrich

2009-08-10 Thread akuhtz

Yes, but trunk doesn't build currently ;-) ... If you commit it later, no
problem.

-- 
View this message in context: 
http://www.nabble.com/Problem-with-FileConsumer-and-pollEnrich-tp24795192p24895196.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Problem with FileConsumer and pollEnrich

2009-08-10 Thread Claus Ibsen
I have committed the file and also added a pre check on the pollEnrich
to indicate that it does not currently support polling from a file
based endpoint when the starting endpoint is also file based.

To implement this properly takes much more work currently than we have
as 2.0 is in its final stages.
And to properly support your use case the pollEnrich needs to support
dynamic URI definition using Expression otherwise you cannot set the
filename you want to consume.

The unit test I added shows how to do this. Using Java code with a
ConsumerTemplate.


On Mon, Aug 10, 2009 at 9:03 AM, akuhtzandreas.ku...@siemens.com wrote:

 Yes, but trunk doesn't build currently ;-) ... If you commit it later, no
 problem.

 --
 View this message in context: 
 http://www.nabble.com/Problem-with-FileConsumer-and-pollEnrich-tp24795192p24895196.html
 Sent from the Camel - Users 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


anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Mick Knutson
from the AMQ list, they suggested I use this JUnit test as an example:
https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java

In the above test, the Producer sends a message to the VirtualTopic and 2
Consumers get this message in individual Durable Queue's.

When I created this, I publish to:

activemq:VirtualTopic.TEST

and then I Consume on:

activemq:Consumer.A.VirtualTopic.TEST



But nothing arrives to my Client. When I change my client to listen on

activemq:VirtualTopic.TEST



The messages are Consumed by the client. This is not what I want. Does
anyone have a working Camel AMQ VirtualTopic JUnit Test that can help me out
please?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---


Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Ashwin Karpe

Hi,

Do you have the rule for the virtual topic setup on the broker. I wonder if
this is the issue. This suspiciously sounds like the case. The virtual
queue/topic is like any other queue or topic from a broker perspective and
only gets interpreted when a payload arrive with the destination name set to
a virtual queue/topic.

If a rule is not found the destination name is treated as a normal/real
queue into which the message is dropped which is why your consumer seems to
get the message when it listens on the queue.

You may want to add a virtual topic rule to the Actiemq broker being used
using activemq.xml


Mick Knutson-3 wrote:
 
 from the AMQ list, they suggested I use this JUnit test as an example:
 https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
 
 In the above test, the Producer sends a message to the VirtualTopic and 2
 Consumers get this message in individual Durable Queue's.
 
 When I created this, I publish to:
 
 activemq:VirtualTopic.TEST
 
 and then I Consume on:
 
 activemq:Consumer.A.VirtualTopic.TEST
 
 
 
 But nothing arrives to my Client. When I change my client to listen on
 
 activemq:VirtualTopic.TEST
 
 
 
 The messages are Consumed by the client. This is not what I want. Does
 anyone have a working Camel AMQ VirtualTopic JUnit Test that can help me
 out
 please?
 
 ---
 Thank You…
 
 Mick Knutson, President
 
 BASE Logic, Inc.
 Enterprise Architecture, Design, Mentoring  Agile Consulting
 p. (866) BLiNC-411: (254-6241-1)
 f. (415) 685-4233
 
 Website: http://baselogic.com
 Linked IN: http://linkedin.com/in/mickknutson
 Vacation Rental: http://tahoe.baselogic.com
 ---
 
 


-
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-Test--tp24902737p24904788.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Mick Knutson
I thought this was already PART of ActiveMQ not a rule that needed to be
added.
But then again, I am just using an embedded broker for these tests.

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 2:20 PM, Ashwin Karpe aska...@progress.com wrote:


 Hi,

 Do you have the rule for the virtual topic setup on the broker. I wonder if
 this is the issue. This suspiciously sounds like the case. The virtual
 queue/topic is like any other queue or topic from a broker perspective and
 only gets interpreted when a payload arrive with the destination name set
 to
 a virtual queue/topic.

 If a rule is not found the destination name is treated as a normal/real
 queue into which the message is dropped which is why your consumer seems to
 get the message when it listens on the queue.

 You may want to add a virtual topic rule to the Actiemq broker being used
 using activemq.xml


 Mick Knutson-3 wrote:
 
  from the AMQ list, they suggested I use this JUnit test as an example:
 
 https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
 
  In the above test, the Producer sends a message to the VirtualTopic and 2
  Consumers get this message in individual Durable Queue's.
 
  When I created this, I publish to:
 
  activemq:VirtualTopic.TEST
 
  and then I Consume on:
 
  activemq:Consumer.A.VirtualTopic.TEST
 
 
 
  But nothing arrives to my Client. When I change my client to listen on
 
  activemq:VirtualTopic.TEST
 
 
 
  The messages are Consumed by the client. This is not what I want. Does
  anyone have a working Camel AMQ VirtualTopic JUnit Test that can help me
  out
  please?
 
  ---
  Thank You…
 
  Mick Knutson, President
 
  BASE Logic, Inc.
  Enterprise Architecture, Design, Mentoring  Agile Consulting
  p. (866) BLiNC-411: (254-6241-1)
  f. (415) 685-4233
 
  Website: http://baselogic.com
  Linked IN: http://linkedin.com/in/mickknutson
  Vacation Rental: http://tahoe.baselogic.com
  ---
 
 


 -
 ---
 Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
 Progress Software Corporation
 14 Oak Park Drive
 Bedford, MA 01730
 ---
 +1-972-304-9084 (Office)
 +1-972-971-1700 (Mobile)
 
 Blog: http://opensourceknowledge.blogspot.com/


 --
 View this message in context:
 http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-Test--tp24902737p24904788.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




Re: bean binding with inheritance 2.0-M3 camel-http

2009-08-10 Thread jjb

Hi

So I got the latest SNAPSHOT and the bean binding issue as well as the
camel-http getResponse issue have been fixed.  Thank you so much for that. 
The last issue I am currently stuck on is the following code:

String body = exchange.getIn().getBody(Sting.class);

I still get an empty String back from this.

Regards


Claus Ibsen-2 wrote:
 
 On Fri, Aug 7, 2009 at 2:40 AM, jjbjj_burf...@yahoo.com wrote:

 Hi

 I have another question regarding how to obtain the body of the HTTP
 message.  Before the latest SNAPSHOT (in 2.0-M2), I used to be able to do
 this:

 String body = (String)exchange.getIn().getBody((new
 String()).getClass());

 This now gives me an empty String.  Do you know how I can get the body of
 an
 HTTP post now?
 
 String body = exchange.getIn().getBody(Sting.class);
 should work.
 
 

 Regards


 jjb wrote:

 Hi, Claus.

 I was hoping to get the latest SNAPSHOT with the HttpMessage.getResponse
 method implemented.  I just updated from the SNAPSHOT repo and verified
 it's not there yet:

 stealth: wget --no-check-certificate
 https://repository.apache.org/content/repositories/snapshots//org/apache/camel/camel-http/2.0-SNAPSHOT/camel-http-2.0-SNAPSHOT.jar
 --2009-08-06 15:28:08--
 https://repository.apache.org/content/repositories/snapshots//org/apache/camel/camel-http/2.0-SNAPSHOT/camel-http-2.0-SNAPSHOT.jar
 Resolving repository.apache.org... 140.211.11.100
 Connecting to repository.apache.org|140.211.11.100|:443... connected.
 WARNING: cannot verify repository.apache.org's certificate, issued by
 `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com,
 Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure
 Certification Authority/serialNumber=07969287':
   Self-signed certificate encountered.
 HTTP request sent, awaiting response... 200 OK
 Length: 42721 (42K) [text/plain]
 Saving to: `camel-http-2.0-SNAPSHOT.jar'

 100%[=]
 42,721      73.7K/s   in 0.6s

 2009-08-06 15:28:09 (73.7 KB/s) - `camel-http-2.0-SNAPSHOT.jar' saved
 [42721/42721]

 stealth: javap -classpath camel-http-2.0-SNAPSHOT.jar
 org.apache.camel.component.http.HttpMessage
 Compiled from HttpMessage.java
 public class org.apache.camel.component.http.HttpMessage extends
 org.apache.camel.impl.DefaultMessage{
     public
 org.apache.camel.component.http.HttpMessage(org.apache.camel.Exchange,
 javax.servlet.http.HttpServletRequest);
     public javax.servlet.http.HttpServletRequest getRequest();
     protected java.lang.Object createBody();
 }

 stealth:


 Do you know when it might make it into the repo?

 Thanks!


 Claus Ibsen-2 wrote:

 Hi

 Also the bean method name issue has been fixed in trunk.
 So if possible please test it at your side by building from source or
 try SNAPSHOT when a new build is published to apache maven repos.

 On Wed, Aug 5, 2009 at 1:55 PM, Claus Ibsenclaus.ib...@gmail.com
 wrote:
 Hi

 Okay I am committing a fix in short time.

 You can grab it using 2 ways
 - from the body using the camel type converter, to avoid ugly java
 type
 casts
 - using java type cast to cast the message to HttpMessage

            // we have access to the HttpServletRequest here and we
 can grab it if we need it
            HttpServletRequest req =
 exchange.getIn().getBody(HttpServletRequest.class);
            assertNotNull(req);

            // we have access to the HttpServletResponse here and we
 can grab it if we need it
            HttpServletResponse res =
 exchange.getIn().getBody(HttpServletResponse.class);
            assertNotNull(res);

            // and they should also be on HttpMessage
            HttpMessage msg = (HttpMessage) exchange.getIn();
            assertNotNull(msg.getRequest());
            assertNotNull(msg.getResponse());

 And use the output stream to write to the servlet response

            // and we can use servlet response to write to output
 stream
 also
            res.getOutputStream().print(Written by servlet response);


 On Wed, Aug 5, 2009 at 10:55 AM, Claus Ibsenclaus.ib...@gmail.com
 wrote:
 Hi

 Cool I have added a ticket to get it back
 https://issues.apache.org/activemq/browse/CAMEL-1879


 On Wed, Aug 5, 2009 at 10:52 AM, jjbjj_burf...@yahoo.com wrote:

 Hi, Claus.

 I built a framework to receive status related messages from a topic
 as
 the
 route is traversed.  Consider the routes the define DerivedClass -
 A
 - B
 - C.  As each segment in the route executes, it sends JAXB/XML
 messages to
 a topic that are then forwarded back to the client via a callback.
  As
 the
 DerivedClass receives these messages, it sends them back over the
 HTTP
 socket (via the HttpServletResponse) to the invoking web client.
  This
 gives
 the web client a realtime flow of XML status updates while the
 different
 endpoints are traversed.  Since I do not want DerivedClass to know
 about
 Camel or JMS, there is a class which DerivedClass 

Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Ashwin Karpe

Hi,

If you do not use a broker.xml to instantiate a broker then you will need to
use brokers API's to add a virtual destination interceptors that
instanctiate a virtual destination.
 
An easier way to accomplish this is to instantiate your embedded broker
using a broker.xml file (provided you use spring). If you had a broker.xml
then the setup would look as follows.

broker xmlns=http://activemq.apache.org/schema/core; 
destinationInterceptors 
  virtualDestinationInterceptor 
virtualDestinations 
  compositeQueue name=MY.QUEUE 
forwardTo 
  filteredDestination selector=odd = 'yes' queue=FOO/ 
  filteredDestination selector=i = 5 topic=BAR/ 
/forwardTo 
  /compositeQueue 
/virtualDestinations 
  /virtualDestinationInterceptor 
/destinationInterceptors 
 
  /broker 

Hope this helps.

Cheers,

Ashwin...


Mick Knutson-3 wrote:
 
 I thought this was already PART of ActiveMQ not a rule that needed to be
 added.
 But then again, I am just using an embedded broker for these tests.
 
 ---
 Thank You…
 
 Mick Knutson, President
 
 BASE Logic, Inc.
 Enterprise Architecture, Design, Mentoring  Agile Consulting
 p. (866) BLiNC-411: (254-6241-1)
 f. (415) 685-4233
 
 Website: http://baselogic.com
 Linked IN: http://linkedin.com/in/mickknutson
 Vacation Rental: http://tahoe.baselogic.com
 ---
 
 
 
 On Mon, Aug 10, 2009 at 2:20 PM, Ashwin Karpe aska...@progress.com
 wrote:
 

 Hi,

 Do you have the rule for the virtual topic setup on the broker. I wonder
 if
 this is the issue. This suspiciously sounds like the case. The virtual
 queue/topic is like any other queue or topic from a broker perspective
 and
 only gets interpreted when a payload arrive with the destination name set
 to
 a virtual queue/topic.

 If a rule is not found the destination name is treated as a normal/real
 queue into which the message is dropped which is why your consumer seems
 to
 get the message when it listens on the queue.

 You may want to add a virtual topic rule to the Actiemq broker being used
 using activemq.xml


 Mick Knutson-3 wrote:
 
  from the AMQ list, they suggested I use this JUnit test as an example:
 
 https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java
 
  In the above test, the Producer sends a message to the VirtualTopic and
 2
  Consumers get this message in individual Durable Queue's.
 
  When I created this, I publish to:
 
  activemq:VirtualTopic.TEST
 
  and then I Consume on:
 
  activemq:Consumer.A.VirtualTopic.TEST
 
 
 
  But nothing arrives to my Client. When I change my client to listen on
 
  activemq:VirtualTopic.TEST
 
 
 
  The messages are Consumed by the client. This is not what I want. Does
  anyone have a working Camel AMQ VirtualTopic JUnit Test that can help
 me
  out
  please?
 
  ---
  Thank You…
 
  Mick Knutson, President
 
  BASE Logic, Inc.
  Enterprise Architecture, Design, Mentoring  Agile Consulting
  p. (866) BLiNC-411: (254-6241-1)
  f. (415) 685-4233
 
  Website: http://baselogic.com
  Linked IN: http://linkedin.com/in/mickknutson
  Vacation Rental: http://tahoe.baselogic.com
  ---
 
 


 -
 ---
 Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
 Progress Software Corporation
 14 Oak Park Drive
 Bedford, MA 01730
 ---
 +1-972-304-9084 (Office)
 +1-972-971-1700 (Mobile)
 
 Blog: http://opensourceknowledge.blogspot.com/


 --
 View this message in context:
 http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-Test--tp24902737p24904788.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


 
 


-
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-Test--tp24902737p24907245.html
Sent from the Camel - Users mailing list archive at Nabble.com.



How to create a Servlet component?

2009-08-10 Thread janylj

Hello,

Camel is pretty new to me. This might be a simple question but I cannot find
the answer in the web. 

I am following Servlet Component page
(http://camel.apache.org/servlet.html). However, when I start Tomcat, there
are repeating warning message said,

Aug 10, 2009 3:44:03 PM
org.apache.camel.impl.DefaultPollingConsumerPollStrategy rollback
WARNING: Consumer Consumer[servlet:/hello] could not poll endpoint:
servlet:/hello caused by: unsupported protocol: 'servlet'
java.lang.IllegalStateException: unsupported protocol: 'servlet'
at
org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149)
at
org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117)
at org.apache.commons.httpclient.HttpHost.init(HttpHost.java:107)
at
org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
at
org.apache.commons.httpclient.HttpMethodBase.init(HttpMethodBase.java:220)
at
org.apache.commons.httpclient.methods.GetMethod.init(GetMethod.java:89)
at
org.apache.camel.component.http.HttpPollingConsumer.createMethod(HttpPollingConsumer.java:110)
at
org.apache.camel.component.http.HttpPollingConsumer.receiveNoWait(HttpPollingConsumer.java:60)
at
org.apache.camel.impl.DefaultScheduledPollConsumer.poll(DefaultScheduledPollConsumer.java:45)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:98)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)

My web.xml has:

!-- location of spring xml files --
context-param
param-namecontextConfigLocation/param-name
param-valueclasspath:camel-config.xml/param-value
/context-param

!-- the listener that kick-starts Spring --
listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener

servlet
servlet-nameCamelServlet/servlet-name
servlet-class

org.apache.camel.component.servlet.CamelHttpTransportServlet 
/servlet-class
init-param
param-namematchOnUriPrefix/param-name
param-valuetrue/param-value
/init-param
/servlet

servlet-mapping
servlet-nameCamelServlet/servlet-name
url-pattern/services/*/url-pattern
/servlet-mapping

The camel-context.xml has:

!-- create a camel context as to start Camel --
camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
packagepackage.has.routebuilderl/package
/camelContext
bean id=servlet 
class=org.apache.camel.component.http.HttpComponent
property name=camelContext ref=camel /
/bean

The RouteBuilder is exactly what lists in the web page.

from(servlet:///hello).process(new Processor() { 
public void process(Exchange exchange) throws Exception { 
String contentType =
exchange.getIn().getHeader(Exchange.CONTENT_TYPE, String.class); 
String path = exchange.getIn().getHeader(Exchange.HTTP_PATH,
String.class); 
assertEquals(Get a wrong content type, CONTENT_TYPE, contentType); 
String charsetEncoding =
exchange.getIn().getHeader(Exchange.HTTP_CHARACTER_ENCODING, String.class); 
assertEquals(Get a wrong charset name, UTF-8, charsetEncoding); 
exchange.getOut().setHeader(Exchange.CONTENT_TYPE, contentType + ;
charset=UTF-8); 
exchange.getOut().setHeader(PATH, path); 
exchange.getOut().setBody(Hello World); 
} 
}); 




-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-Servlet-component--tp24909157p24909157.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to create a Servlet component?

2009-08-10 Thread janylj



janylj wrote:
 
 
 The camel-context.xml has:
 
 !-- create a camel context as to start Camel --
   camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
   packagepackage.has.routebuilderl/package
   /camelContext
   bean id=servlet 
 class=org.apache.camel.component.http.HttpComponent
   property name=camelContext ref=camel /
   /bean
 
 

I figure that I should not have a HttpComponent for servlet scheme because
HttpComponent is only for output data. Then what component I should set for
servlet. If I delete HttpComponent part, Tomat has error.

SEVERE: Context initialization failed
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
servlet:///hello due to: No component found with scheme: servlet
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:411)

-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-Servlet-component--tp24909157p24909247.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to create a Servlet component?

2009-08-10 Thread Willem Jiang

Hi,

You need to include the camel-servlet jar which is not a part of 
camel-http module and the camel-servlet component is a new component for 
camel 2.0 M3.


I will update the wiki page for it.

Willem

janylj wrote:



janylj wrote:


The camel-context.xml has:

!-- create a camel context as to start Camel --
camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
packagepackage.has.routebuilderl/package
/camelContext
bean id=servlet 
class=org.apache.camel.component.http.HttpComponent
property name=camelContext ref=camel /
/bean




I figure that I should not have a HttpComponent for servlet scheme because
HttpComponent is only for output data. Then what component I should set for
servlet. If I delete HttpComponent part, Tomat has error.

SEVERE: Context initialization failed
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
servlet:///hello due to: No component found with scheme: servlet
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:411)





Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Mick Knutson
So I changed my server context.xml with this broker:

bean id=broker class=org.apache.activemq.xbean.BrokerFactoryBean
property name=config
value=classpath:META-INF/broker.xml /
property name=start value=true /
/bean


I then added this broker.xml:

broker xmlns=http://activemq.apache.org/schema/core;
transportConnectors
transportConnector name=tcp
uri=tcp://localhost:61616 /
/transportConnectors

destinationInterceptors
virtualDestinationInterceptor
virtualDestinations
compositeQueue name=MY.QUEUE
forwardTo
filteredDestination selector=odd = 'yes'
queue=FOO /
filteredDestination selector=i = 5 topic=BAR /
/forwardTo
/compositeQueue
virtualTopic name= prefix=VirtualTopicConsumers.*. /
/virtualDestinations
/virtualDestinationInterceptor
/destinationInterceptors
/broker

Then when I start the Client Side Unit Tests:

6178 [main] DEBUG org.apache.camel.component.direct.DirectConsumer  -
Starting consumer: Consumer[direct://start]
 6179 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 0:
EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
-
UnitOfWork(pipeline[channel[com.wiredducks.service.test.tableservicetest$clientchec...@7acdff36],
Channel[sendTo(Endpoint[mock://player1])]])]
 6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 1:
EventDrivenConsumerRoute[Endpoint[direct://start] -
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]
 6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Started
routes
 6180 [main] INFO  org.apache.camel.impl.DefaultCamelContext  - Apache Camel
2.0-M3 (CamelContext:camel-2) started
 6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
Rules are: 
*[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
- *
UnitOfWork(pipeline[channel[com.wiredducks.service.test.tableservicetest$clientchec...@7acdff36],
Channel[sendTo(Endpoint[mock://player1])]])],
EventDrivenConsumerRoute[Endpoint[direct://start] - *
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]*
 6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
Rules are:
[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
-
UnitOfWork(pipeline[channel[com.wiredducks.service.test.tableservicetest$clientchec...@7acdff36],
*Channel[sendTo(Endpoint[mock://player1])]])],
EventDrivenConsumerRoute[Endpoint[direct://start] -
UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]]*
 6180 [main] INFO  com.wiredducks.service.test.TableServiceTest  - Invoking
TableService to place a bet of 987 from player 123
 6181 [main] DEBUG org.apache.camel.impl.DefaultComponentResolver  - Found
component: jms via type: org.apache.camel.component.jms.JmsComponent via:
META-INF/services/org/apache/camel/component/jms



When I send a message from my Server to:
producer.sendBodyAndHeader(activemq:VirtualTopicConsumers.1, 888, foo,
bar);


---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 1:48 PM, Ashwin Karpe aska...@progress.com wrote:


 Hi,

 If you do not use a broker.xml to instantiate a broker then you will need
 to
 use brokers API's to add a virtual destination interceptors that
 instanctiate a virtual destination.

 An easier way to accomplish this is to instantiate your embedded broker
 using a broker.xml file (provided you use spring). If you had a broker.xml
 then the setup would look as follows.

 broker xmlns=http://activemq.apache.org/schema/core;
destinationInterceptors
  virtualDestinationInterceptor
virtualDestinations
  compositeQueue name=MY.QUEUE
forwardTo
  filteredDestination selector=odd = 'yes' queue=FOO/
  filteredDestination selector=i = 5 topic=BAR/
/forwardTo
  /compositeQueue
/virtualDestinations
  /virtualDestinationInterceptor
/destinationInterceptors

  /broker

 Hope this helps.

 Cheers,

 Ashwin...


 Mick Knutson-3 wrote:
 
  I thought this was already PART of ActiveMQ not a rule that needed to be
  added.
  But then again, I am just using an embedded broker for these tests.
 
  ---
  Thank You…
 
  Mick Knutson, President
 
  BASE Logic, Inc.
  Enterprise Architecture, Design, Mentoring  Agile Consulting
  p. (866) BLiNC-411: (254-6241-1)
  f. (415) 685-4233
 
  Website: http://baselogic.com
  Linked IN: http://linkedin.com/in/mickknutson
  Vacation Rental: 

Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Mick Knutson
I get no message delivered.

I see the Topic getting created;

[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name=To[activemq:VirtualTopicConsumers.1]
[myproject] DEBUG [main] DefaultComponentResolver.resolveComponent(77) |
Found component: activemq via type:
org.apache.activemq.camel.component.ActiveMQComponent via:
META-INF/services/org/apache/camel/component/activemq
[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://VirtualTopicConsumers.1],
path=[VirtualTopicConsumers.1], parameters=[{}]
[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://VirtualTopicConsumers.1 converted to endpoint:
Endpoint[activemq://VirtualTopicConsumers.1] by component:
org.apache.activemq.camel.component.activemqcompon...@6179a0ab
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name=activemq://VirtualTopicConsumers.1\?id=0x6d67751d
[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://Player.VirtualTopicConsumers.1],
path=[Player.VirtualTopicConsumers.1], parameters=[{}]
[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://Player.VirtualTopicConsumers.1 converted to endpoint:
Endpoint[activemq://Player.VirtualTopicConsumers.1] by component:
org.apache.activemq.camel.component.activemqcompon...@6179a0ab
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name=activemq://Player.VirtualTopicConsumers.1\?id=0xc44497bc
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=process1,name=process[com.wiredducks.service.test.tableservicetest$clientchec...@709e192f
]
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to2,name=To[mock:player1]




---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 5:06 PM, Mick Knutson mknut...@baselogic.comwrote:

 So I changed my server context.xml with this broker:

 bean id=broker class=org.apache.activemq.xbean.BrokerFactoryBean
 property name=config
 value=classpath:META-INF/broker.xml /
 property name=start value=true /
 /bean


 I then added this broker.xml:

 broker xmlns=http://activemq.apache.org/schema/core;
 transportConnectors
 transportConnector name=tcp
 uri=tcp://localhost:61616 /
 /transportConnectors

 destinationInterceptors
 virtualDestinationInterceptor
 virtualDestinations
 compositeQueue name=MY.QUEUE
 forwardTo
 filteredDestination selector=odd = 'yes'
 queue=FOO /
 filteredDestination selector=i = 5 topic=BAR
 /
 /forwardTo
 /compositeQueue
 virtualTopic name= prefix=VirtualTopicConsumers.*. /
 /virtualDestinations
 /virtualDestinationInterceptor
 /destinationInterceptors
 /broker

 Then when I start the Client Side Unit Tests:

 6178 [main] DEBUG org.apache.camel.component.direct.DirectConsumer  -
 Starting consumer: Consumer[direct://start]
  6179 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 0:
 EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
 -
 UnitOfWork(pipeline[channel[com.wiredducks.service.test.tableservicetest$clientchec...@7acdff36],
 Channel[sendTo(Endpoint[mock://player1])]])]
  6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Route 1:
 EventDrivenConsumerRoute[Endpoint[direct://start] -
 UnitOfWork(Channel[sendTo(Endpoint[activemq://VirtualTopicConsumers.1])])]
  6180 [main] DEBUG org.apache.camel.impl.DefaultCamelContext  - Started
 routes
  6180 [main] INFO  org.apache.camel.impl.DefaultCamelContext  - Apache
 Camel 2.0-M3 (CamelContext:camel-2) started
  6180 [main] DEBUG com.wiredducks.service.test.TableServiceTest  - Routing
 Rules are: 
 *[EventDrivenConsumerRoute[Endpoint[activemq://Player.VirtualTopicConsumers.1]
 - *
 

Re: How to create a Servlet component?

2009-08-10 Thread janylj

I add camel-servlet to pom.xml and in the camel-context.xml, I added:

bean id=servlet
class=org.apache.camel.component.servlet.ServletComponent
property name=camelContext ref=camel /
/bean

However, I still get the following error when starting Tomcat.

SEVERE: Context initialization failed
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
Can't find the deployied servlet, please set the ServletComponent with it or
delopy a CamelHttpTransportServlet int the web container
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:461)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

willem.jiang wrote:
 
 Hi,
 
 You need to include the camel-servlet jar which is not a part of 
 camel-http module and the camel-servlet component is a new component for 
 camel 2.0 M3.
 
 I will update the wiki page for it.
 
 Willem
 
 janylj wrote:
 
 
 janylj wrote:

 The camel-context.xml has:

 !-- create a camel context as to start Camel --
 camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
 packagepackage.has.routebuilderl/package
 /camelContext
 bean id=servlet
 class=org.apache.camel.component.http.HttpComponent
 property name=camelContext ref=camel /
 /bean


 
 I figure that I should not have a HttpComponent for servlet scheme
 because
 HttpComponent is only for output data. Then what component I should set
 for
 servlet. If I delete HttpComponent part, Tomat has error.
 
 SEVERE: Context initialization failed
 org.apache.camel.ResolveEndpointFailedException: Failed to resolve
 endpoint:
 servlet:///hello due to: No component found with scheme: servlet
  at
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:411)
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-Servlet-component--tp24909157p24909831.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to create a Servlet component?

2009-08-10 Thread Willem Jiang

Hi,

You don't need to specify the servlet component in spring, if there is 
only one camel servlet created in the web context.


If you create the servlet component, you need to specify the servlet 
which the component will attach to.

bean id=servlet
class=org.apache.camel.component.servlet.ServletComponent
property name=camelContext ref=camel /
property name=servletName value=CamelServlet /
/bean

Web.xml

web-app

  servlet
servlet-nameCamelServlet/servlet-name
display-nameCamel Http Transport Servlet/display-name
servlet-class
org.apache.camel.component.servlet.CamelHttpTransportServlet
/servlet-class
init-param
  param-namematchOnUriPrefix/param-name
  param-valuetrue/param-value
/init-param
  /servlet

  servlet-mapping
servlet-nameCamelServlet/servlet-name
url-pattern/services/*/url-pattern
  /servlet-mapping

/web-app

Willem
janylj wrote:

I add camel-servlet to pom.xml and in the camel-context.xml, I added:

bean id=servlet
class=org.apache.camel.component.servlet.ServletComponent
property name=camelContext ref=camel /
/bean

However, I still get the following error when starting Tomcat.

SEVERE: Context initialization failed
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
Can't find the deployied servlet, please set the ServletComponent with it or
delopy a CamelHttpTransportServlet int the web container
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1011)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:461)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

willem.jiang wrote:

Hi,

You need to include the camel-servlet jar which is not a part of 
camel-http module and the camel-servlet component is a new component for 
camel 2.0 M3.


I will update the wiki page for it.

Willem

janylj wrote:


janylj wrote:

The camel-context.xml has:

!-- create a camel context as to start Camel --
camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
packagepackage.has.routebuilderl/package
/camelContext
bean id=servlet
class=org.apache.camel.component.http.HttpComponent
property name=camelContext ref=camel /
/bean



I figure that I should not have a HttpComponent for servlet scheme
because
HttpComponent is only for output data. Then what component I should set
for
servlet. If I delete HttpComponent part, Tomat has error.

SEVERE: Context initialization failed
org.apache.camel.ResolveEndpointFailedException: Failed to resolve

Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Willem Jiang

According to AMQ's document
The out-of-the-box defaults are described above. Namely that the only 
virtual topics available must be within the VirtualTopic. namespace and 
that the consumer queues are named Consumer.*.VirtualTopic..


The support is out of box, and there is no addition configuration file 
for the unit test.


BTW, did you start to listen the Consumer.A.VirtualTopic.TEST queue 
before you send the message to VirtualTopic.TEST ?


Willem

Mick Knutson wrote:

I thought this was already PART of ActiveMQ not a rule that needed to be
added.
But then again, I am just using an embedded broker for these tests.

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 2:20 PM, Ashwin Karpe aska...@progress.com wrote:


Hi,

Do you have the rule for the virtual topic setup on the broker. I wonder if
this is the issue. This suspiciously sounds like the case. The virtual
queue/topic is like any other queue or topic from a broker perspective and
only gets interpreted when a payload arrive with the destination name set
to
a virtual queue/topic.

If a rule is not found the destination name is treated as a normal/real
queue into which the message is dropped which is why your consumer seems to
get the message when it listens on the queue.

You may want to add a virtual topic rule to the Actiemq broker being used
using activemq.xml


Mick Knutson-3 wrote:

from the AMQ list, they suggested I use this JUnit test as an example:


https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java

In the above test, the Producer sends a message to the VirtualTopic and 2
Consumers get this message in individual Durable Queue's.

When I created this, I publish to:

activemq:VirtualTopic.TEST

and then I Consume on:

activemq:Consumer.A.VirtualTopic.TEST



But nothing arrives to my Client. When I change my client to listen on

activemq:VirtualTopic.TEST



The messages are Consumed by the client. This is not what I want. Does
anyone have a working Camel AMQ VirtualTopic JUnit Test that can help me
out
please?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---




-
---
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
---
+1-972-304-9084 (Office)
+1-972-971-1700 (Mobile)

Blog: http://opensourceknowledge.blogspot.com/


--
View this message in context:
http://www.nabble.com/anyone-have-AMQ-VirtualTopic%27s-working-in-Camel-Test--tp24902737p24904788.html
Sent from the Camel - Users mailing list archive at Nabble.com.








Re: anyone have AMQ VirtualTopic's working in Camel Test?

2009-08-10 Thread Mick Knutson
I changed the Topic to *activemq:VirtualTopic.TEST* and the consumer queue
to *activemq:Consumer.A.VirtualTopic.TEST*

I see that the MDP and Topic get created:

[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=processors,nodeid=to1,name=
*To[activemq:VirtualTopic.TEST]*
[myproject] DEBUG [main] DefaultComponentResolver.resolveComponent(77) |
Found component: activemq via type:
org.apache.activemq.camel.component.ActiveMQComponent via:
META-INF/services/org/apache/camel/component/activemq
*[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://VirtualTopic.TEST]*, path=[VirtualTopic.TEST],
parameters=[{}]
*[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://VirtualTopic.TEST converted to endpoint:
Endpoint[activemq://VirtualTopic.TEST] by component:
org.apache.activemq.camel.component.activemqcompon...@47b7c1b7*
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name=activemq://VirtualTopic.TEST\?id=0x5cab2ebd
[myproject] DEBUG [main] DefaultComponent.createEndpoint(77) | Creating
endpoint uri=[activemq://Consumer.A.VirtualTopic.TEST],
path=[Consumer.A.VirtualTopic.TEST], parameters=[{}]
*[myproject] DEBUG [main] DefaultCamelContext.getEndpoint(387) |
activemq://Consumer.A.VirtualTopic.TEST converted to endpoint:
Endpoint[activemq://Consumer.A.VirtualTopic.TEST] by component:
org.apache.activemq.camel.component.activemqcompon...@47b7c1b7*
[myproject] DEBUG [main]
DefaultInstrumentationAgent.registerMBeanWithServer(293) | Registered MBean
with objectname:
org.apache.camel:context=mick-knutsons-macbook.local/camel-2,type=endpoints,name=activemq://Consumer.A.VirtualTopic.TEST\?id=0x561756a4



Each was converted to a AMQ Component. Is that correct?

The MDP gets initialized as the client gets initialized. Then AFTER the
client and server are both running, then I send a message to the server, to
have the server create a message to the VirtualTopic.TEST



---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring  Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Mon, Aug 10, 2009 at 6:12 PM, Willem Jiang willem.ji...@gmail.comwrote:

 According to AMQ's document
 The out-of-the-box defaults are described above. Namely that the only
 virtual topics available must be within the VirtualTopic. namespace and
 that the consumer queues are named Consumer.*.VirtualTopic..

 The support is out of box, and there is no addition configuration file for
 the unit test.

 BTW, did you start to listen the Consumer.A.VirtualTopic.TEST queue before
 you send the message to VirtualTopic.TEST ?

 Willem


 Mick Knutson wrote:

 I thought this was already PART of ActiveMQ not a rule that needed to be
 added.
 But then again, I am just using an embedded broker for these tests.

 ---
 Thank You…

 Mick Knutson, President

 BASE Logic, Inc.
 Enterprise Architecture, Design, Mentoring  Agile Consulting
 p. (866) BLiNC-411: (254-6241-1)
 f. (415) 685-4233

 Website: http://baselogic.com
 Linked IN: http://linkedin.com/in/mickknutson
 Vacation Rental: http://tahoe.baselogic.com
 ---



 On Mon, Aug 10, 2009 at 2:20 PM, Ashwin Karpe aska...@progress.com
 wrote:

  Hi,

 Do you have the rule for the virtual topic setup on the broker. I wonder
 if
 this is the issue. This suspiciously sounds like the case. The virtual
 queue/topic is like any other queue or topic from a broker perspective
 and
 only gets interpreted when a payload arrive with the destination name set
 to
 a virtual queue/topic.

 If a rule is not found the destination name is treated as a normal/real
 queue into which the message is dropped which is why your consumer seems
 to
 get the message when it listens on the queue.

 You may want to add a virtual topic rule to the Actiemq broker being used
 using activemq.xml


 Mick Knutson-3 wrote:

 from the AMQ list, they suggested I use this JUnit test as an example:


 https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java

 In the above test, the Producer sends a message to the VirtualTopic and
 2
 Consumers get this message in individual Durable Queue's.

 When I created this, I publish to:

 activemq:VirtualTopic.TEST

 and then I Consume on:

 activemq:Consumer.A.VirtualTopic.TEST



 But nothing arrives to my Client. When I change my client to listen on

 activemq:VirtualTopic.TEST



 The messages are Consumed by the client. This is not what I want. Does
 anyone have a working Camel AMQ VirtualTopic JUnit Test