Using the Servlet component in a Blueprint container

2013-04-16 Thread Andreas Gies
provider);
  }

  public void setServlets(List servlets) {
providers.clear();
for (Servlet servlet : servlets) {
  if (servlet instanceof CamelServlet) {
providers.add((CamelServlet) servlet);
  }
}
  }
}

The trick here is in the register / unregister method reacting to the
CamelServletProvider interface.

Now I was able to stick all of that together in a bundle configuration:



http://www.osgi.org/xmlns/blueprint/v1.0.0";
  xmlns:camel="http://camel.apache.org/schema/blueprint";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="
  http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint-2.10.3.xsd
">

  
  

  
  

  

  
  

  

  




  
  http://localhost:8080/camel/services/test"; />




  
  
  


  




If you think this is usefull, I am happy to stick it in the wiki rather than
in the user's list.


Best regards
Andreas
Andreas Gies

WoQ ­ Way of Quality UG



Geschäftsführer & CTO

eMail: andr...@wayofquality.de

Tel DE: +49 151 23470823

Tel UK: +44 755 1381918

Fax: +49 1805 006534 2114


Amtsgericht Landshut: HRB 8352
Ust.-Id.: DE274771254
Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte Informationen
enthalten und ist ausschließlich für den/die benannten Adressaten bestimmt.
Sollten Sie nicht der beabsichtigte Empfänger sein oder diese Email
irrtümlich erhalten haben, ist es Ihnen nicht gestattet diese Mail oder
einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu kopieren, unbefugt
weiterzuleiten oder zu behalten. Informieren Sie bitte sofort den Absender
telefonisch oder per Email und löschen Sie diese Email und alle Kopien aus
Ihrem System. Wir haften nicht für die Unversehrtheit von Emails, nachdem
sie unseren Einflussbereich verlassen haben.

Disclaimer

This email may contain confidential and/or privileged information and is
intended solely for the attention and use of the named addressee(s). If you
are not the intended recipient, or a person responsible for delivering it to
the intended recipient, you are not authorized to and must not disclose,
copy, distribute, or retain this message or any part of it without our
authority. Please contact the sender by call or reply email immediately and
destroy all copies and the original message. We are not responsible for the
integrity of emails after they have left our sphere of control.







Question regarding reconnecting JMS provider

2017-05-30 Thread Andreas Gies

Hello,

we are using Camel 2.17.3 within an integration application with quite a 
few data sources, 3 of which are JMS providers.


For all our internal traffic we use ActiveMQ 5.14, the external 
providers are SonicMQ and Software AG Universal Messaging.


The application runs within an OSGi container based on Apache Felix.

We are using Connection Caching within our application, so that we open 
only one connection to any JMS provider.



When the connection to any remote provider is lost, we would expect that 
after a reconnect a consuming Camel route would


pick up messages again. However, we only see the expected behavior only 
for ActiveMQ and Sonic, but not for SAG Universal


Messaging.


Question 1 : Is our expectation correct in the first place ?

Question 2 : Could someone point me to the code that would control such 
a JMS session refresh or is Camel entirely relying on Spring

for this ?


Thank you very much in advance

Andreas Gies



camel-osgi bundle

2013-04-22 Thread Andreas Gies
Hello, 

Is the camel-osgi bundle deprecated ? - The latest version I can find is
2.3.0. 
I was trying to create a Camel Context in Java with the
OsgiDefaultCamelContext(bundleContext),
but then my container complains about org.apache.camel.core.osgi not being
found as an import.

Thanks and best regards
Andreas




Re: camel-osgi bundle

2013-04-22 Thread Andreas Gies
Hi, 

Yes, that does the trick. My mistake was that I tried to create the
CamelContext in Java.
Now I am creating it via blueprint and inject a RouteBuilder.

Thanks 
Andreas



Andreas Gies


WoQ ­ Way of Quality UG

http://www.wayofquality.de


Geschäftsführer & CTO

eMail: andr...@wayofquality.de

Tel DE: +49 151 23470823



Tel UK: +44 755 1381918



Fax: +49 1805 006534 2114


Amtsgericht Landshut: HRB 8352
Ust.-Id.: DE274771254

Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte Informationen
enthalten und ist ausschließlich für den/die benannten Adressaten
bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein oder diese
Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet diese Mail
oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu kopieren,
unbefugt weiterzuleiten oder zu behalten. Informieren Sie bitte sofort den
Absender telefonisch oder per Email und löschen Sie diese Email und alle
Kopien aus Ihrem System. Wir haften nicht für die Unversehrtheit von
Emails, nachdem sie unseren Einflussbereich verlassen haben.
Disclaimer

This email may contain confidential and/or privileged information and is
intended solely for the attention and use of the named addressee(s). If
you are not the intended recipient, or a person responsible for delivering
it to the intended recipient, you are not authorized to and must not
disclose, copy, distribute, or retain this message or any part of it
without our authority. Please contact the sender by call or reply email
immediately and destroy all copies and the original message. We are not
responsible for the integrity of emails after they have left our sphere of
control.








Am 4/22/13(17) 12:47 PM schrieb "Achim Nierbeck" unter
:

>Hi,
>
>you'll need to switch to camel-blueprint, that'll work better for you.
>
>regards, Achim
>
>
>2013/4/22 Andreas Gies 
>
>> Hello,
>>
>> Is the camel-osgi bundle deprecated ? - The latest version I can find is
>> 2.3.0.
>> I was trying to create a Camel Context in Java with the
>> OsgiDefaultCamelContext(bundleContext),
>> but then my container complains about org.apache.camel.core.osgi not
>>being
>> found as an import.
>>
>> Thanks and best regards
>> Andreas
>>
>>
>>
>
>
>-- 
>
>Apache Karaf <http://karaf.apache.org/> Committer & PMC
>OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
>Project Lead
>OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
>Commiter & Project Lead
>blog <http://notizblog.nierbeck.de/>




Re: Testing camel component resolving in OSGI with Pax Exam

2013-04-23 Thread Andreas Gies
Hi, 

Have you considered using the camel-blueprint-testing support ?
This is what I use to test my Camel based OSGi bundle and that
gives me good results.

Best regards
Andreas

Andreas Gies


WoQ ­ Way of Quality UG

http://www.wayofquality.de


Geschäftsführer & CTO

eMail: andr...@wayofquality.de

Tel DE: +49 151 23470823



Tel UK: +44 755 1381918



Fax: +49 1805 006534 2114


Amtsgericht Landshut: HRB 8352
Ust.-Id.: DE274771254

Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte Informationen
enthalten und ist ausschließlich für den/die benannten Adressaten
bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein oder diese
Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet diese Mail
oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu kopieren,
unbefugt weiterzuleiten oder zu behalten. Informieren Sie bitte sofort den
Absender telefonisch oder per Email und löschen Sie diese Email und alle
Kopien aus Ihrem System. Wir haften nicht für die Unversehrtheit von
Emails, nachdem sie unseren Einflussbereich verlassen haben.
Disclaimer

This email may contain confidential and/or privileged information and is
intended solely for the attention and use of the named addressee(s). If
you are not the intended recipient, or a person responsible for delivering
it to the intended recipient, you are not authorized to and must not
disclose, copy, distribute, or retain this message or any part of it
without our authority. Please contact the sender by call or reply email
immediately and destroy all copies and the original message. We are not
responsible for the integrity of emails after they have left our sphere of
control.








Am 4/23/13(17) 7:11 PM schrieb "lleclerc" unter :

>
>Here is my complete test class :
>http://pastie.org/private/19vmbn8hb3sdwxawy5qxg
>
>My test consist of creating a quartz endpoint.
>
>
>All my bundle are state 32 (Started)
>Bundle 0 org.eclipse.osgi State is 32
>Bundle 1 org.ops4j.pax.exam State is 32
>Bundle 2 org.ops4j.pax.exam.inject State is 32
>Bundle 3 org.ops4j.pax.exam.extender.service State is 32
>Bundle 4 osgi.cmpn State is 32
>Bundle 5 org.ops4j.pax.logging.pax-logging-api State is 32
>Bundle 6 org.ops4j.base State is 32
>Bundle 7 org.ops4j.pax.swissbox.core State is 32
>Bundle 8 org.ops4j.pax.swissbox.extender State is 32
>Bundle 9 org.ops4j.pax.swissbox.framework State is 32
>Bundle 10 org.ops4j.pax.swissbox.lifecycle State is 32
>Bundle 11 org.apache.geronimo.specs.geronimo-atinject_1.0_spec State is 32
>Bundle 12 org.apache.camel.camel-core State is 32
>Bundle 13 org.apache.camel.camel-core-osgi State is 32
>Bundle 14 org.apache.servicemix.bundles.quartz State is 32
>Bundle 15 org.apache.camel.camel-quartz State is 32
>Bundle 16 PAXEXAM-PROBE-f109411f-6dac-4560-a43a-458a41d97914 State is 32
>
>Here is the pom.xml :
>http://pastie.org/private/3bh9dnr4ou549op8wemxa
>
>Please tell me what is wrong in this test. Thank you !
>
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Testing-camel-component-resolving-in-OSG
>I-with-Pax-Exam-tp5731373.html
>Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Elaborating on Claus' answer. The XSLT processor tries to resolve the XSLT
"test/test.xsl". 
In OSGI words, it has to resolve a package "test" which contains the
resource test.xsl. 

Though exporting the package "test" would probably work, I would strongly
recommend to have 
better qualified package names to avoid name clashes in exports.
Especially generically named
packages like "test" or "sample" may very well lead into a world of pain
(been there). 

Once you go about exporting packages, think what you want / need to expose
to other bundles. 
I always keep my internal stuff in a package ending in ".internal" and
have configured my builds
not to export something that matches this pattern.

Good luck 
Andreas







Am 7/16/13(29) 9:29 AM schrieb "Claus Ibsen" unter :

>If the xsl file is in the classpath of your own bundle, then you need
>to export this package. Looks like you put it in a test package.
>
>On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
> wrote:
>> I must update my previous question:
>> velocity in facts works fine, it is just xslt which causing issues!
>>
>> My test route is in fact:
>> 
>> 
>> 
>> Foo
>> 
>> 
>> 
>> 
>> 
>>
>> the velocity: endpoint works, it is the xslt: which fail...
>> I'm able to run it if I use the full path for just the XSL file:
>>
>> 
>> 
>> 
>> Foo
>> 
>> 
>> > 
>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
>>st/test.xsl"
>> />
>> 
>> 
>>
>> Anyone has any suggestion on how to address this problem?
>>
>> My only suspect is that when I run from eclipse a simple java class
>>with a
>> main(String[] args) method where I start a
>>ConfigurableApplicationContext)
>> where it works, and when I deploy on OSGi, I'm actually using two
>>different
>> XSLT processors, but I'm not sure how to debug it...
>>
>> thank you again,
>>
>> Cristiano
>>
>>
>>
>>
>> 2013/7/16 Cristiano Costantini 
>>
>>> Hello,
>>>
>>> I just tried to deploy my camel routes into an OSGi environment
>>> (ServiceMix).
>>>
>>> I've made a simple maven project with just resources (the beans.xml,
>>>.xsl
>>> and .vm files),
>>> however the XSLT and Velocity endpoints cannot find the associated
>>>files (
>>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>>>due
>>> to: java.io.FileNotFoundException: Cannot find resource in classpath
>>>for
>>> URI: testTransform.xsl").
>>>
>>> If I run the route locally (in a simple java console application)
>>> everything works fine.
>>>
>>> Anyone has experience on this type of deployment and can give me some
>>>hint?
>>>
>>> Thank you,
>>> Cristiano
>>>
>
>
>
>-- 
>Claus Ibsen
>-
>Red Hat, Inc.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen




Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Depending on how you start your OSGi container, you can always add the
configuration for remote debugging to your launcher script.
For my own development I have written a small wrapper around Pax Exam that
uses a container.properties file to set the JVM's runtime
paramaters (incl. debugging). For inspiration you can have a look at

https://github.com/atooni/de.woq.osgi.java/blob/master/de.woq.osgi.java.lau
ncher/src/main/java/de/woq/osgi/java/container/Main.java

For me that works very well and I use pax-runner composites to keep my
container profiles around.

Best regards 
Andreas




Am 7/16/13(29) 9:41 AM schrieb "Cristiano Costantini" unter
:

>Hi Claus and thank you,
>
>the XSL file is on the "src/main/resources/test" folder, and in the same
>folder there is the velocity template.
>
>I've tried to add test to maven bundle
>plugin but nothing changed.
>Is this the correct way to export it?
>
>also it's weird the velocity template on the same folder is found without
>exporting explicitly the package, I expect I would have the same issue
>with
>it.
>
>The exception is caused on class ResourceHelper  ==>
>
>Caused by: java.io.FileNotFoundException: Cannot find resource in
>classpath
>for URI: vm\test.xsl
>at
>org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream
>(ResourceHelper.java:106)
>at
>org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:
>81)
>
>I will try to check the code of ResourceHelper but I don't know how to
>debug when using OSGI (yet).
>
>thank you,
>
>Cristiano
>
>
>
>
>
>2013/7/16 Claus Ibsen 
>
>> If the xsl file is in the classpath of your own bundle, then you need
>> to export this package. Looks like you put it in a test package.
>>
>> On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>>  wrote:
>> > I must update my previous question:
>> > velocity in facts works fine, it is just xslt which causing issues!
>> >
>> > My test route is in fact:
>> > 
>> > 
>> > 
>> > Foo
>> > 
>> > 
>> > 
>> > 
>> > 
>> >
>> > the velocity: endpoint works, it is the xslt: which fail...
>> > I'm able to run it if I use the full path for just the XSL file:
>> >
>> > 
>> > 
>> > 
>> > Foo
>> > 
>> > 
>> > > >
>> 
>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
>>st/test.xsl"
>> > />
>> > 
>> > 
>> >
>> > Anyone has any suggestion on how to address this problem?
>> >
>> > My only suspect is that when I run from eclipse a simple java class
>>with
>> a
>> > main(String[] args) method where I start a
>>  ConfigurableApplicationContext)
>> > where it works, and when I deploy on OSGi, I'm actually using two
>> different
>> > XSLT processors, but I'm not sure how to debug it...
>> >
>> > thank you again,
>> >
>> > Cristiano
>> >
>> >
>> >
>> >
>> > 2013/7/16 Cristiano Costantini 
>> >
>> >> Hello,
>> >>
>> >> I just tried to deploy my camel routes into an OSGi environment
>> >> (ServiceMix).
>> >>
>> >> I've made a simple maven project with just resources (the beans.xml,
>> .xsl
>> >> and .vm files),
>> >> however the XSLT and Velocity endpoints cannot find the associated
>> files (
>> >> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>>due
>> >> to: java.io.FileNotFoundException: Cannot find resource in classpath
>>for
>> >> URI: testTransform.xsl").
>> >>
>> >> If I run the route locally (in a simple java console application)
>> >> everything works fine.
>> >>
>> >> Anyone has experience on this type of deployment and can give me some
>> hint?
>> >>
>> >> Thank you,
>> >> Cristiano
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> Email: cib...@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>




Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Hi

I have used that instruction in the past. By now I find it easier to
configure the bundle plugin including a file "osgi.bnd"
which lives in the bundle root directory alongside the pom file.

The bundle-plugin would be configured as:


  org.apache.felix
  maven-bundle-plugin
  2.3.7
  true
  

  manifest
  process-classes
  
  manifest
 

  
  

jar
bundle
war
  
  
<_include>-osgi.bnd
  
  



Note that this configuration also allows me to OSGIFY wars and jars if I
need it. 

A typical osgi.bnd file would look like:

Bundle-Version:\
  ${project.version}

Bundle-SymbolicName:\
  ${bundle.symbolicName}; singleton:=true

Export-Package: ${bundle.namespace}

Import-Package: \
  *

Private-Package: \
  ${bundle.namespace}.internal


The variables ${bundle.namespace} and ${bundle.symbolicName} always
resolve to my artifactId, which is in my bundles always
${project.groupId} + "." + uniqueidentifier.


Having this kind of structure kind of gives you a natural order of
packages and exports.

Have fun
Andreas







Am 7/16/13(29) 9:48 AM schrieb "Cristiano Costantini" unter
:

>Thank you Andreas for the hints on how to layout the packages.
>
>(I'm just studying how to make it work and not yet started to refine the
>code style,
>I will surely take care of your recommendation.)
>
>Could you confirm right way to export a resource in OSGi is to use the
> instruction?
>
>Thank you,
>
>Cristiano
>
>
>
>
>
>2013/7/16 Andreas Gies 
>
>> Elaborating on Claus' answer. The XSLT processor tries to resolve the
>>XSLT
>> "test/test.xsl".
>> In OSGI words, it has to resolve a package "test" which contains the
>> resource test.xsl.
>>
>> Though exporting the package "test" would probably work, I would
>>strongly
>> recommend to have
>> better qualified package names to avoid name clashes in exports.
>> Especially generically named
>> packages like "test" or "sample" may very well lead into a world of pain
>> (been there).
>>
>> Once you go about exporting packages, think what you want / need to
>>expose
>> to other bundles.
>> I always keep my internal stuff in a package ending in ".internal" and
>> have configured my builds
>> not to export something that matches this pattern.
>>
>> Good luck
>> Andreas
>>
>>
>>
>>
>>
>>
>>
>> Am 7/16/13(29) 9:29 AM schrieb "Claus Ibsen" unter
>>> >:
>>
>> >If the xsl file is in the classpath of your own bundle, then you need
>> >to export this package. Looks like you put it in a test package.
>> >
>> >On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>> > wrote:
>> >> I must update my previous question:
>> >> velocity in facts works fine, it is just xslt which causing issues!
>> >>
>> >> My test route is in fact:
>> >> 
>> >> 
>> >> 
>> >> Foo
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >>
>> >> the velocity: endpoint works, it is the xslt: which fail...
>> >> I'm able to run it if I use the full path for just the XSL file:
>> >>
>> >> 
>> >> 
>> >> 
>> >> Foo
>> >> 
>> >> 
>> >> > >>
>> 
>>>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/
>>>>te
>> >>st/test.xsl"
>> >> />
>> >> 
>> >> 
>> >>
>> >> Anyone has any suggestion on how to address this problem?
>> >>
>> >> My only suspect is that when I run from eclipse a simple java class
>> >>with a
>> >> main(String[] args) method where I start a
>> >>ConfigurableApplicationContext)
>> >> where it works, and when I deploy on OSGi, I'm actually using two
>> >>different
>> >> XSLT processors, but I'm not sure how to debug it...
>> >>
>> >> thank you again,
>> >>
>> >> Cristiano
>> >>
>> >>
>> >>
>> >>
>> >> 2013/7/16 Cristiano Costantini 
>> >>
>> >>> Hello,
>> >>>
>> >>> I just tried to deploy my camel routes into an OSGi environment
>> >>> (ServiceMix).
>> >>>
>> >>> I've made a simple maven project with just resources (the beans.xml,
>> >>>.xsl
>> >>> and .vm files),
>> >>> however the XSLT and Velocity endpoints cannot find the associated
>> >>>files (
>> >>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>> >>>due
>> >>> to: java.io.FileNotFoundException: Cannot find resource in classpath
>> >>>for
>> >>> URI: testTransform.xsl").
>> >>>
>> >>> If I run the route locally (in a simple java console application)
>> >>> everything works fine.
>> >>>
>> >>> Anyone has experience on this type of deployment and can give me
>>some
>> >>>hint?
>> >>>
>> >>> Thank you,
>> >>> Cristiano
>> >>>
>> >
>> >
>> >
>> >--
>> >Claus Ibsen
>> >-
>> >Red Hat, Inc.
>> >Email: cib...@redhat.com
>> >Twitter: davsclaus
>> >Blog: http://davsclaus.com
>> >Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>>




Re: Round Robin in Camel Routes

2013-07-18 Thread Andreas Gies
Still kind of confused ;)

If I understand correctly you have 3 inbound routes from different
locations all of which point to a Active MQ Queue.

If you have only one consumer the messages will be processed in the order
they arrive in the queue (wellŠin the simplest case)
regardless where they came from.

If you have more than one consumer on the queue, that changes. The
messages will be processed in a round robin fashion
across your consumers. If you want to have a dedicated set of consumers
for each inbound endpoint, I would suggest different queues.
If you can't do that you can use message selectors or filters in camel.

If you need to route groups of messages to the same consumer, you should
have a look at ActiveMQ's message group feature
(http://activemq.apache.org/message-groups.html).


I *think* that reading between the lines you are expecting your consumers
to actively fetch messages. IMHO an ESB architecture
is primarily event driven, so that the inbound side pushes messages and
the consumer side is notified when those messages arrive.
The underlying JMS Broker (in this case ActiveMQ) allows all kind of
dispatching strategies.


Hope that helps
Andreas







Am 7/18/13(29) 7:02 PM schrieb "deepak_a" unter :

>Hi,
>
>I was not clear in my earlier query.
>let me clarify.
>
>In my current architecture I have multiple routes set up.
>Each route has has a unique 'from' point and a 'to' end point (that is
>common for all routes)
>
>e.g.
>
>Route 1: From: MQ-Queue;To: inbound.Queue (in activeMQ)
>Route 2: From: FTP; To: inbound.Queue (in activeMQ)
>Route 3: From: Webservice;   To: inbound.Queue (in activeMQ)
>
>The issue I am facing is - since my destination (To end point) is Queue
>that
>is common for all routes, I am not able to evenly process the messages
>from
>each endpoint.
>
>My query is is it possible to set up one route like this
>
>Route 1:
>From: MQ-Queue;
>From: FTP;
>From: Webservice; 
>To: inbound.Queue (in activeMQ)
>
>The same route consumes messages from each from point in a round-robin
>manner and push message to the destination?
>
>
>regards
>D
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Round-Robin-in-Camel-Routes-tp5735857p57
>35860.html
>Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Hello World? Maybe not :)

2013-07-18 Thread Andreas Gies
Hmmm 

Looks good enough to me. Is there any error message to share ? Which
version of Camel are you using ?
If you are willing to post your route I can drop it in my IDE tomorrow Š.


Regards
Andreas






Am 7/18/13(29) 7:12 PM schrieb "Gershaw, Geoffrey" unter
:

>Hi Claus,
>
>Embarrassingly, I've used camel for quite some time. Always with
>quickfixj or jms with the spring config. I never had to kick things off.
>When I look at the examples, they look like mine.
>
>Shouldn't this be it?
>
>
>>
>> 
>>
>>loggingLevel="INFO"/>
>>
>> 
>
>Geoffrey A Gershaw
>Credit eTrading Development
>+1 919 994 6412 (*102 6412)
>
>-Original Message-
>From: Claus Ibsen [mailto:claus.ib...@gmail.com]
>Sent: Thursday, July 18, 2013 1:06 PM
>To: users@camel.apache.org
>Subject: Re: Hello World? Maybe not :)
>
>Hi
>
>I suggest to take a look at this page
>http://camel.apache.org/walk-through-an-example.html
>
>The direct component is here
>http://camel.apache.org/direct
>
>And if you just want to print hello world once or every X period then
>you can use a timer in the route
>http://camel.apache.org/timer
>
>And I suggest to try the console example as its good for learning and
>trying out Camel
>http://camel.apache.org/console-example.html
>
>The example is included in the Camel distro so you can compile and run
>it, as documented from the link above.
>
>On Thu, Jul 18, 2013 at 6:40 PM, Gershaw, Geoffrey
> wrote:
>> Hi All,
>>
>>
>>
>> I have the simplest problem that apparently I can't figure out. I've
>> never used direct:start as an endpoint before and I can't seem to get
>it
>> to work the way I would expect it to.
>>
>>
>>
>> My config is below . I would like the route to start and print hello
>> world. Seems easy. What am I overlooking?
>>
>>
>>
>> Thanks for your help
>>
>>
>>
>> 
>>
>> >
>> xmlns="http://www.springframework.org/schema/beans";
>>
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>
>>
>> xmlns:context="http://www.springframework.org/schema/context";
>>
>> xmlns:util="http://www.springframework.org/schema/util";
>>
>> xmlns:camel="http://camel.apache.org/schema/spring";
>>
>>
>>
>xsi:noNamespaceSchemaLocation="http://camel.apache.org/schema/spring/cam
>> el-spring.xsd"
>>
>> xsi:schemaLocation="
>>
>>
>> http://www.springframework.org/schema/beans
>>
>>
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>
>>
>> http://www.springframework.org/schema/context
>>
>>
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>>
>>
>> http://www.springframework.org/schema/util
>>
>>
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>>
>>
>> http://camel.apache.org/schema/spring
>>
>>
>> http://camel.apache.org/schema/spring/camel-spring.xsd
>>
>> ">
>>
>>
>>
>> xmlns="http://camel.apache.org/schema/spring";
>>>
>>
>> 
>>
>> > contextPath="com.prasad.sample"/>
>>
>> 
>>
>>
>>
>> 
>>
>> 
>>
>> > loggingLevel="INFO"/>
>>
>> 
>>
>> 
>>
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>> Geoffrey A Gershaw
>>
>> CREDIT SUISSE
>>
>> Information Technology | Credit eTrading Development, KFVB 525
>>
>> 7033 Louis Stephens Drive | 27560 Research Triangle Park | United
>States
>>
>> Phone +1 919 994 6412
>>
>> geoffrey.gers...@credit-suisse.com | www.credit-suisse.com
>> 
>>
>>
>>
>>
>>
>>
>
>===
>> Please access the attached hyperlink for an important electronic
>communications disclaimer:
>> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>>
>
>===
>>
>
>
>
>-- 
>Claus Ibsen
>-
>Red Hat, Inc.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen
>
>
>==
>= 
>Please access the attached hyperlink for an important electronic
>communications disclaimer:
>http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>==
>= 
>




Re: Hello World? Maybe not :)

2013-07-18 Thread Andreas Gies
Hi, 

Perhaps it's with posting your test as well ?

Best regards
Andreas



Am 7/18/13(29) 11:37 PM schrieb "Gershaw, Geoffrey" unter
:

>I'm running this in a standalone java app using Spring.  Its camel 2.11.
>I was under the impression from the various samples that I have seen that
>the below route should start and print Hello World without publishing a
>message to this route. Like a main class in java.  Am I wrong? I am using
>the timer component right now to do the same job.
>
>Right now, there is no error. It just keeps running, but Hello World
>isn't printed.
>
>Thanks
>
>
>
>> 
>>
>> 
>>
>> > loggingLevel="INFO"/>
>>
>> 
>>
>Geoffrey A Gershaw
>Credit eTrading Development
>+1 919 994 6412 (*102 6412)
>
>
>-Original Message-
>From: Raul Kripalani [mailto:r...@evosent.com]
>Sent: Thursday, July 18, 2013 2:21 PM
>To: users@camel.apache.org
>Subject: Re: Hello World? Maybe not :)
>
>Hey Geoffrey,
>
>A stacktrace would help us help you ;-)
>
>Where and how are you deploying this route? Apache ServiceMix? Tomcat,
>JBoss, etc.?
>
>And is there another Camel route or a unit test publishing to the direct
>endpoint? Bear in mind that a direct consumer doesn't listen on an
>external
>interface/protocol. It's rather intended for in-memory, internal
>Camel-to-Camel invocations.
>
>Thanks,
>
>*Raúl Kripalani*
>Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
>Integration specialist
>http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>http://blog.raulkr.net | twitter: @raulvk
>
>On Thu, Jul 18, 2013 at 6:40 PM, Gershaw, Geoffrey <
>geoffrey.gers...@credit-suisse.com> wrote:
>
>> Hi All,
>>
>>
>>
>> I have the simplest problem that apparently I can't figure out. I've
>> never used direct:start as an endpoint before and I can't seem to get it
>> to work the way I would expect it to.
>>
>>
>>
>> My config is below . I would like the route to start and print hello
>> world. Seems easy. What am I overlooking?
>>
>>
>>
>> Thanks for your help
>>
>>
>>
>> 
>>
>> >
>> xmlns="http://www.springframework.org/schema/beans";
>>
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>
>>
>> xmlns:context="http://www.springframework.org/schema/context";
>>
>> xmlns:util="http://www.springframework.org/schema/util";
>>
>> xmlns:camel="http://camel.apache.org/schema/spring";
>>
>>
>> xsi:noNamespaceSchemaLocation="http://camel.apache.org/schema/spring/cam
>> el-spring.xsd"
>>
>> xsi:schemaLocation="
>>
>>
>> http://www.springframework.org/schema/beans
>>
>>
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>
>>
>> http://www.springframework.org/schema/context
>>
>>
>> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>>
>>
>> http://www.springframework.org/schema/util
>>
>>
>> http://www.springframework.org/schema/util/spring-util-3.0.xsd
>>
>>
>> http://camel.apache.org/schema/spring
>>
>>
>> http://camel.apache.org/schema/spring/camel-spring.xsd
>>
>> ">
>>
>>
>>
>> http://camel.apache.org/schema/spring";
>> >
>>
>> 
>>
>> > contextPath="com.prasad.sample"/>
>>
>> 
>>
>>
>>
>> 
>>
>> 
>>
>> > loggingLevel="INFO"/>
>>
>> 
>>
>> 
>>
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>> Geoffrey A Gershaw
>>
>> CREDIT SUISSE
>>
>> Information Technology | Credit eTrading Development, KFVB 525
>>
>> 7033 Louis Stephens Drive | 27560 Research Triangle Park | United States
>>
>> Phone +1 919 994 6412
>>
>> geoffrey.gers...@credit-suisse.com | www.credit-suisse.com
>> 
>>
>>
>>
>>
>>
>>
>> 
>>=
>>==
>> Please access the attached hyperlink for an important electronic
>> communications disclaimer:
>> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>>
>> 
>>=
>>==
>>
>>
>
>
>==
>= 
>Please access the attached hyperlink for an important electronic
>communications disclaimer:
>http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
>==
>= 
>




Re: camel integration in servicemix

2013-07-22 Thread Andreas Gies
Hi Geert, 

Perhaps there are other ways of doing it, but i found reusing the Camel
HTTP servlet right out of the box a bit un-OSGI-ish, so that would be true
for ServiceMix as well.
I have published a blog entry explaining in more detail what the issue was
and I addressed it:

http://www.wayofquality.de/index.php/en/blog/entry/using-the-camel-servlet-
component-in-an-osgi-blueprint-container


I am using pax-web as an HTTP service implementation, but the blog simply
assumes that you some form of http service and hopefully the
pax-web-extender installed.


Hope that helps 
Andreas



Andreas Gies


WoQ ­ Way of Quality UG

http://www.wayofquality.de


Geschäftsführer & CTO

eMail: andr...@wayofquality.de

Tel DE: +49 151 23470823



Tel UK: +44 755 1381918



Fax: +49 1805 006534 2114


Amtsgericht Landshut: HRB 8352
Ust.-Id.: DE274771254

Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte Informationen
enthalten und ist ausschließlich für den/die benannten Adressaten
bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein oder diese
Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet diese Mail
oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu kopieren,
unbefugt weiterzuleiten oder zu behalten. Informieren Sie bitte sofort den
Absender telefonisch oder per Email und löschen Sie diese Email und alle
Kopien aus Ihrem System. Wir haften nicht für die Unversehrtheit von
Emails, nachdem sie unseren Einflussbereich verlassen haben.
Disclaimer

This email may contain confidential and/or privileged information and is
intended solely for the attention and use of the named addressee(s). If
you are not the intended recipient, or a person responsible for delivering
it to the intended recipient, you are not authorized to and must not
disclose, copy, distribute, or retain this message or any part of it
without our authority. Please contact the sender by call or reply email
immediately and destroy all copies and the original message. We are not
responsible for the integrity of emails after they have left our sphere of
control.








Am 7/22/13(30) 3:33 PM schrieb "Geert Bozz" unter :

>Hello all,
>
>I 'm looking for information on how camel is integrated into servicemix
>and
>I have two questions. I want to start by shortly explaining my
>understanding, this might benefit others and it helps putting my questions
>into its context. If I understand correctly,
>
>1) Camel has an http component which is supposed to point to a jetty http
>server, I can imagine this is an embedded http server when camel is used
>stand-alone.
>2) I 'm quite sure that ServiceMix fullsfulls the osgi http service
>contract by using the pax web server, which also happens to be a jetty
>http
>server.
>
>My first question now is: has the camel-servicemix module been modified so
>that it uses the servicemix http server? How was this done? Is it just a
>matter of configuring the camel bundle?
>
>If I want to get under the hood of the http server used by the pair
>camel-servicemix, how do I best tackle this? Is it sufficient to look at
>the default jetty server that comes with servicemix, or do I need to focus
>on the configuration of the jetty component that comes with camel, and
>documented here: http://camel.apache.org/jetty.html.
>
>
>thanks,
>
>geert




Re: Custom names for processors within routes

2013-07-23 Thread Andreas Gies
Works like a charm; as expected ;)

Thx
Andreas



Am 7/22/13(30) 5:22 PM schrieb "Claus Ibsen" unter :

>Hi
>
>Yep set the id of the processors. Then that id is used as part of the JMX
>name
>http://camel.apache.org/camel-jmx.html
>
>.process( ... ).id("nameOfMyProcessor")
>
>On Mon, Jul 22, 2013 at 5:19 PM,   wrote:
>>
>> Hello,
>>
>> I apologize if the following is a stupid question.
>>
>> I have a Custom Routebuilder building a route within a Camel Context.
>>The
>> route itself works fine.
>>
>> The code is relatively straight forward:
>>
>>   @Override
>>   public void configure() throws Exception {
>> errorHandler(deadLetterChannel(getErrorUri()));
>>
>> from(getEntryUri())
>> .process(getProcessor())
>> .process(new Processor() {
>>   @Override
>>   public void process(Exchange exchange) throws Exception {
>> exchange.setOut(exchange.getIn());
>>
>> if (dispatcher == null) {
>>   throw new Exception("No dispatcher configured. Have you set
>>the
>> exit prefix ?");
>> }
>>
>> dispatcher.dispatch(exchange);
>>   }
>> });
>>   }
>>
>> I am using Java as I use an OSGI Managed Service to configure the
>>duspatcher
>> at runtime and also to inject a pre processor as a first step.
>> Also I found that injecting those into a Java route builder allowed me
>>to
>> unit test the processors more elegantly.
>>
>> Back to the point...In JVisualVm I can see my processors in the tree
>>beneath
>> a folder named after my route identifier. Beneath this entry i see two
>> processors named processor1 and processor2.
>>
>> Is there any way to influence those last 2 names from my route builder
>>? -
>> Potentially I have overlooked something in the docs ...
>>
>> For convenience I have attached a piece of my JVisualVM screenshot that
>> shows the processors in question.
>>
>> Best regards
>> Andreas
>>
>>
>>
>
>
>
>-- 
>Claus Ibsen
>-
>Red Hat, Inc.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen




Re: Camel Thread does not terminate

2013-07-23 Thread Andreas Gies
Hi,

It might be my complete ignorance of the problem, but have you considered
to leave your context happily running and take advantage of the many
mechanisms in Camel to leverage Thread pools and the like ?

Just my 2 ct 
Andreas 


Am 7/23/13(30) 7:26 AM schrieb "SyedBhai" unter
:

>No.  That doesn't help.  Because it will shutdown the jvm.
>My project is a web app.  It keeps serving incoming requests.  For serving
>each request it uses camel framework.
>I am creating a thread for each request.  The problem I may be facing is
>that this thread does not terminate because of using camel.  So I wanted
>to
>know how to stop this thread.
>Can someone help please?
>
>Thanks,
>Syed.
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Camel-Thread-does-not-terminate-tp573604
>5p5736060.html
>Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Web based camel route automation

2013-09-06 Thread Andreas Gies

Hi,

in theory you could configure a generic camel route between two files 
and use a property resolver
to route from file1 to file2. Then its a matter of sticking the 
properties into the right location on disk

and initialize your Camel route accordingly on startup.

This having said, the JVM could still crash between collecting the file 
names and writing the property

file.

As Charles pointed out, a CamelContext is an Object in memory, so it 
comes down to having a somewhat dynamic

initializer.


Bet regards
Andreas


On 09/05/2013 07:27 PM, Charles Moulliard wrote:

Guru,

A CamelContext is a java object which is not persisted or replicated
between different JVM. So this is not possible to achieve what you would
like to do. The question here is not the CamelContext or RouteBuilder
object but what you transport (= files). They must be persisted (using
ActiveMQ, RDBMS, NoSQL, ...) to avoid to loose if JVM crashes.

Regards,

Charles


On Thu, Sep 5, 2013 at 7:16 PM, Gnanaguru S 
wrote:
Hello,

I have two file endpoints, I need to route the files using camel routes.

I have a web UI where I will provide the two file endpoints detail, One I
submit the details It has to create a camel context file.

1. I am able to achieve this using route builder, but this is in-memory.
When the JVM crashes, I have to re-run the program. Is there any solution
which keep the camel context even when the JVM gets restarted ?

2. It would be helpful, if I can create routes dynamically in spring dsl.

Any thoughts ?

Thanks
Guru
gnanaguru.com



--
View this message in context:
http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
Sent from the Camel - Users mailing list archive at Nabble.com.








Re: Camel routing issue after upgrade into active-mq 5.8

2013-09-06 Thread Andreas Gies

Hmmm,

to me the log output seems to document what you are after.
Maybe you want to rephrase the question and / or provide your route
and a test case ? - A description of what you are trying to achieve might
also help.

I haven't seen answers to the questions that have been asked:

Are you using transacted routes ? - What is the TTL of your messages ?
Is the entire use case run on a single machine ? - Have you examined
the inflight messages as suggested ?



Best regards
Andreas


On 09/05/2013 08:46 PM, prabumc...@gmail.com wrote:

I am using camel 2.10.3 version
On Sep 5, 2013 10:22 PM, "Prabu"  wrote:


Pls help me...

*Thanks*
Prabu.N


On Thu, Sep 5, 2013 at 6:41 PM, Prabu  wrote:


Hi Ceposta,

After enable debug i can see following log details.

2013-09-05 08:02:41,023 | DEBUG |
Endpoint[activemq://queue:BOA.InboundQueue] consumer received JMS message:
ActiveMQTextMessage {commandId = 24, responseRequired = true, messageId =
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20, originalDestination =
null, originalTransactionId = null, producerId =
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1, destination =
queue://BOA.InboundQueue, transactionId = null, expiration = 0, timestamp =
1378386161018, arrival = 0, brokerInTime = 1378386161020, brokerOutTime =
1378386161022, correlationId = null, replyTo = null, persistent = true,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = org.apache.activemq.util.ByteSequence@58b94e98,
dataStructure = null, redeliveryCounter = 0, size = 1539, properties =
{MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/,
EXPIRY_TIME=30, TestEventType=LogMessage,
soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = true,
readOnlyBody = true, droppable = false, text = {"creationDate":"Sep 05,
2013 8:02:41 AM","na...nterval":0}
} | org.apache.camel.component.jms.EndpointMessageListener | Camel
(camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]
2013-09-05 08:02:41,024 | DEBUG | #0 - header{header(soft_EVENT_TYPE)} is
not null matches: true for: Exchange[JmsMessage[JmsMessageID:
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20]] |
org.apache.camel.processor.ChoiceProcessor | Camel (camelContext1) thread
#0 - JmsConsumer[BOA.InboundQueue]

2013-09-05 08:02:41,025 | DEBUG | Redelivery enabled: false on error
handler:
DefaultErrorHandler[Producer[activemq://queue:Inbound.Memos.Consumer.Test]]
| org.apache.camel.processor.DefaultErrorHandler | Camel (camelContext1)
thread #0 - JmsConsumer[BOA.InboundQueue]
2013-09-05 08:02:41,025 | DEBUG | Executing callback on JMS Session:
Cached JMS Session: ActiveMQSession
{id=ID:pitb-mw-msg0a02.test.aus.soft.net-3432-1378385347963-3:1:30,started=true}
| org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate | Camel
(camelContext1) thread #0 - JmsConsumer[BOA.InboundQueue]

2013-09-05 08:02:41,026 | DEBUG | Sending JMS message to:
queue://Inbound.Memos.Consumer.Test with message: ActiveMQTextMessage
{commandId = 0, responseRequired = false, messageId = null,
originalDestination = null, originalTransactionId = null, producerId =
null, destination = null, transactionId = null, expiration = 0, timestamp =
0, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null,
replyTo = null, persistent = true, type = null, priority = 4, groupID =
null, groupSequence = 0, targetConsumerId = null, compressed = false,
userID = null, content = null, marshalledProperties = null, dataStructure =
null, redeliveryCounter = 0, size = 0, properties =
{MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8, PAST_EVENT_INTERVAL=0,
MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
breadcrumbId=ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20,
RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/,
EXPIRY_TIME=30, CamelJmsDeliveryMode=2, TestEventType=LogMessage,
soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = false,
readOnlyBody = false, droppable = false, text = {"creationDate":"Sep 05,
2013 8:02:41 AM","na...nterval":0}


*Thanks*
Prabu.N



On Thu, Sep 5, 2013 at 11:36 AM, Prabu  wrote:


*Queue name*

public static final String CONSUMER_TEST_QNAME   =
"activemq:queue:ConsumerTestHandlerjmsMessageType=Text&preserveMessageQos=true";

public static final String PRODUCER_TEST_QNAME=
"activemq:queue:ProducerTestHandler?jmsMessageType=Text&preserveMessageQos=true";

public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME
  = "activemq:queue:Inbound.Memos.Consumer.Test";

public static final String MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME
  = "activemq:queue:Inbound.Memos.Producer.Test";

Sorry,I am new to camel.So i am sure what your asking.

Re: Web based camel route automation

2013-09-06 Thread Andreas Gies
I don't want to be nagging, but personally I wouldn't go down the route 
(hmm...nice play of words) of
creating routes dynamically from the application. Personally I would 
stick to having the route in my

source code and therefore tagged and released and tested etc.

Generating the config can only break so much ...

In other words, leave the structure untouched, but keep the endpoints 
flexible. For example, what if

you wanted to add a wiretap later on for some kind of auditing ?

In one of my applications I use a similar pattern and have the endpoints 
flexible and reconfigurable via JMS

control messages.

My 2ct
Andreas

On 09/06/2013 09:48 AM, Gnanaguru S wrote:

Thanks for the clarification Charles & Andreas, I understand. I hope there
is a roadmap for this in Camel 3.0 .

Claus, This is the best available solution as of now, which I consider using
it.

Cheers,
Guru
gnanaguru.com



--
View this message in context: 
http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797p5738829.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Camel routing issue after upgrade into active-mq 5.8

2013-09-06 Thread Andreas Gies

It might be me, but does that code compile ?

You are calling

from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(_*new
MemosProcess(getContext().createProducerTemplate())*_)
.end();

But the class you are showing doesn't have a constructor that takes a 
producerTemplate ?

Just to be sure, the message wouldn't be routed with your code. Instead You 
would be creating a new message
with the body "Consumer Test" and whatever headers you are setting.

If that is what you want, I am inclined to think that you should add a to step 
to your route:

from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME)
 .process(new MemosProcess(getContext().createProducerTemplate()))
 .to("activemq:topic:dev.null");

Note, that sending the message to the other Queue is some kind of "side effect" 
with your code.

One thing to check is the clock on your machines...if they are not in sync you 
sometimes see odd things happening.
As you are not setting TTL's i don't think that'd affect you.


A final word, you might want to look at the excellent Camel Test support 
(http://camel.apache.org/camel-test.html).
This will let you run Camel routes within JUnit test, create mock endpoints and 
create / validate assertions for them.


Hope that helps
Andreas



On 09/06/2013 10:06 AM, prabumc...@gmail.com wrote:

Thanks so much fro reply .

I am not setting TTL for any messages

If i run test case in single machine ( test case and broker) it worked fine.

Issue is when i run test case connecting broker which is running
in separate machine.

I have 2 different queue

public static final String MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME  =
"activemq:queue:Inbound.Memos.Consumer.Test";

public static final String CONSUMER_TEST_QNAME  =
"activemq:queue:ConsumerTestHandler?jmsMessageType=Text&preserveMessageQos=true";


from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(new
MemosProcess(getContext().createProducerTemplate()))
.end();


class MemosProcess implements Processor,QnamesInterface {
   @Override
   public void process(Exchange exchange) throws Exception {

   JmsMessage msg = (JmsMessage) exchange.getIn();
   -
   -
   prodtemplate.sendBodyAndHeaders(CONSUMER_TEST_QNAME,"Consumer
test",headers);
   }
   }


Messages stayed in Inbound.Memos.Consumer.Test not routed into
ConsumerTestHandler.

it worked fine in active-mq 5.5

Please kindly help

Issue only in active 5.8 and camel 2.10.3

*Regards*
Prabu.N


On Fri, Sep 6, 2013 at 1:16 PM, Andreas Gies [via Camel] <
ml-node+s465427n5738828...@n5.nabble.com> wrote:


Hmmm,

to me the log output seems to document what you are after.
Maybe you want to rephrase the question and / or provide your route
and a test case ? - A description of what you are trying to achieve might
also help.

I haven't seen answers to the questions that have been asked:

Are you using transacted routes ? - What is the TTL of your messages ?
Is the entire use case run on a single machine ? - Have you examined
the inflight messages as suggested ?



Best regards
Andreas


On 09/05/2013 08:46 PM, [hidden 
email]<http://user/SendEmail.jtp?type=node&node=5738828&i=0>wrote:


I am using camel 2.10.3 version
On Sep 5, 2013 10:22 PM, "Prabu" <[hidden 
email]<http://user/SendEmail.jtp?type=node&node=5738828&i=1>>

wrote:

Pls help me...

*Thanks*
Prabu.N


On Thu, Sep 5, 2013 at 6:41 PM, Prabu <[hidden 
email]<http://user/SendEmail.jtp?type=node&node=5738828&i=2>>

wrote:

Hi Ceposta,

After enable debug i can see following log details.

2013-09-05 08:02:41,023 | DEBUG |
Endpoint[activemq://queue:BOA.InboundQueue] consumer received JMS

message:

ActiveMQTextMessage {commandId = 24, responseRequired = true,

messageId =

ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1:20, originalDestination =
null, originalTransactionId = null, producerId =
ID:Corp-TSOpus02-50552-1378385398624-4:1:1:1, destination =
queue://BOA.InboundQueue, transactionId = null, expiration = 0,

timestamp =

1378386161018, arrival = 0, brokerInTime = 1378386161020,

brokerOutTime =

1378386161022, correlationId = null, replyTo = null, persistent =

true,

type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content =

null,

marshalledProperties = org.apache.activemq.util.ByteSequence@58b94e98,
dataStructure = null, redeliveryCounter = 0, size = 1539, properties =
{MESSAGE_ID=cde10e13-5e66-4dac-88bd-acc05aa091e8,

PAST_EVENT_INTERVAL=0,

MEMOS_TARGET_SERVERS=PITB-MW-MSG0A01:PITB-MW-MSG0A02,
soft_EVENT_CLASS_NAME=com.soft.event.TestEvent, soft_EVENT_VERSION=1,
RESTFUL_SERVICE_URL=http://Corp-TSOpus02:5050/memos/,
EXPIRY_TIME=30, TestEventType=LogMessage,
soft_EVENT_TYPE=Memos.Consumer.Test}, readOnlyProperties = true,
rea

Re: Are there any Camel hack to make all the JMS component to use one and only thread?

2013-09-06 Thread Andreas Gies

One thing to keep in mind when you are experiencing odering issues is
that you can use ActiveMQ's message groups to make all messages for
one group to the same consumer. Very often that little trick helps
and still allows some form of concurrency for different groups.

Andreas

On 09/05/2013 11:54 PM, gnani swami wrote:

Some of the messages where handled by wrong service and they are all queued
in FailedErrorMessages directory. Application failed to process them. So it
will end up in ordering, and lost message.  Looking at our various
exception it is quite easy for us to understand that they are caused by
concurrency bug inside the buz logic.

We like to move the  to new route
under some endpoint (in-mem-queue). Quick google doesn't return anything
related to multiplex, could you point me sample route?  Can I create that
multiplex in the new route under new endpoint.

Thanks



On Fri, Sep 6, 2013 at 12:35 AM, Christian Posta
wrote:


So what's the underlying concurrency issue? Ordering? Can you just have a
route that multiplexes all of those incoming queues into a single queue (or
in-mem queue) and then have a route w/ only one thread that does CBR and
invoke the correct bean?


On Thu, Sep 5, 2013 at 9:02 AM, gnani swami 
wrote:
Hi,

Camel was wonderful piece of software and using it in production for more
than a year.  Our version of Camel was 2.10.1

I recently added few additional route (and bug in buz logic too) to
interface with additional systems, all the routes are doing the similar
job. They read JMS message from an unique-end-point (MQ JMS Queue) and
invoke buzComponent (Camel component).

But recently discovered that some subtle concurrency issues inside the
buzComponent causing trouble to us. And I am looking for some sort of

Camel

hack to prevent it from further damage by making all the end-point

consumer

to use one and only thread.

1) As a short term solution, we like to convert all the JMS component to
use single threaded threadPool (or taskExecutor), and that new thread

pool

shouldn't allow more than a thread across all the JMS end-point.  Is it
possible?  We are not worried about latency and performance for some

time.

2) if there is a possibility, our camel error handlers were already
in-place, Can we assume that single thread would continue working despite
any exception configured to errorHandler. ErrorHandlers will have its own
thread.

3) I am also happy to introduce one or more route and end-point inside
camelcontex.xml, so all the buzComponent can be redirected into that new
route to make it SingleThreaded execution somehow.. are there any
suggestion to use some  camel component (We could use any hack as long as
configurable inside xml).

I am pretty sure all the above approach may be short sighted, but looking
for temporary solution which could work for few days. We are happy to
modify Camel xml, than changing code and making it complex.

I appreciate feedback.

Regards
Mohan


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 



 
 
 ...
 
 





--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta





Re: Can not consume messages which are sent to temp queue using 2 different camel contexts

2013-09-09 Thread Andreas Gies

Hi,

this is because JMS temporary Objects are usually bound to the connect 
in which they have been created.
Therefore these are invisible elsewhere. You are using contexts and I 
would assume you are using the normal setup

and hace 2 connections.

This is why it doesn't work with a temp queue, but it does with a normal 
queue.


Best regards
Andreas

On 09/08/2013 05:14 PM, Nhan Nguyen wrote:

Hi all,

I have 2 machines, one for producer and one for consumer. Sometime I need to
create some temp queues for sending/receiving messages. But I see that I can
not use temp queue this case. All messages are lot. I suspect the cause is
due to using 2 different camel contexts so I wrote below code to test:

JmsEndpoint endpoint1 =
c1.getCamelContext().getEndpoint("activemq:temp:queue:t",
JmsEndpoint.class);
JmsEndpoint endpoint2 =
c2.getCamelContext().getEndpoint("activemq:temp:queue:t",
JmsEndpoint.class);

Consumer consumer = endpoint2.createConsumer(new Processor() {

@Override
public void process(Exchange exchange) throws Exception 
{
System.out.println(exchange.getIn().getBody());
}
});
consumer.start();

ProducerTemplate producer =
c1.getCamelContext().createProducerTemplate();

Exchange exchange = endpoint1.createExchange();
exchange.getIn().setBody("test");
producer.send(endpoint1, exchange);

And the result the consumer could not receive message "test"... I changed
the temp queue "t" to physical queue ("activemq:queue:t") and it works
fine...

Can someone explain the reason and how can I use temp queue this case?

I am using ActiveMQ 5.8.0 and Camel 2.11.0.

Thanks,
Nhan



--
View this message in context: 
http://camel.465427.n5.nabble.com/Can-not-consume-messages-which-are-sent-to-temp-queue-using-2-different-camel-contexts-tp5738891.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Is the higher OSGi version really needed?

2013-09-09 Thread Andreas Gies

Hmmm,

I see your point and can't answer whether the version change is really 
required.
I would challenge the claim that camel can't be used in a "real" OSGi 
application.
I am using Camel all the time in OSGi based apps and I would call them 
real as they

solve real problems.

This having said, I am packaging the application myself and therefore 
can choose a fitting OSGi

provider.

Best regards
Andreas

On 09/09/2013 09:38 AM, JavaAdam wrote:

Hi,

I have tried to deploy an OSGi application based on Apache Camel 2.11.1 on a
IBM WebSphere Application Server 8. But I failed, because Camel 2.11.1
requires a newer OSGi Specification than the WAS provides (Equinox 3.6.1).
My investigation shows that the import version of org.osgi.util.tracker was
increased from 1.4 to 1.5 in 2.11.x. I wonder if this version jump is really
needed or if it just happend automatically because of some dependencies in
the build system?

Fact is, that Apache Camel cannot be used on WAS 8 within a "real" OSGi
application based on the provided OSGi platform.

Indeed the solution could be to provide an own OSGi platform embedded in my
application. But this is not my favorite solution.

Thanks
Adam





--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-the-higher-OSGi-version-really-needed-tp5738924.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Is the higher OSGi version really needed?

2013-09-09 Thread Andreas Gies

Point taken ;) - Was half joking.

Andreas

On 09/09/2013 12:10 PM, Christian Schneider wrote:
I think what he meant is that Camel currently can not run as  a real 
OSGi application in Websphere App Server 8.
So in this environment it would be really great if we could lower the 
minimum needed OSGi version.


I checked what OSGi release matches the update from package version 
1.4 to 1.5.
This seems to be the update from version 4.2 to 4.3. I think the main 
difference is that we have API packages for version 4.3(.1) that 
support generics on Java 7. Not sure if we depend on any other API 
changes.


On the other hand it might be quite some effort to make sure we import 
only the lower package version while not switching everything back to 
4.2.


I am not too familiar with Websphere. Is there a newer version that 
supports OSGi 4.3? I have seen there is version 8.5 of websphere but 
did not see any details about the supported OSGi specs.


Christian



On 09.09.2013 11:48, Andreas Gies wrote:

Hmmm,

I see your point and can't answer whether the version change is 
really required.
I would challenge the claim that camel can't be used in a "real" OSGi 
application.
I am using Camel all the time in OSGi based apps and I would call 
them real as they

solve real problems.

This having said, I am packaging the application myself and therefore 
can choose a fitting OSGi

provider.

Best regards
Andreas

On 09/09/2013 09:38 AM, JavaAdam wrote:

Hi,

I have tried to deploy an OSGi application based on Apache Camel 
2.11.1 on a

IBM WebSphere Application Server 8. But I failed, because Camel 2.11.1
requires a newer OSGi Specification than the WAS provides (Equinox 
3.6.1).
My investigation shows that the import version of 
org.osgi.util.tracker was
increased from 1.4 to 1.5 in 2.11.x. I wonder if this version jump 
is really
needed or if it just happend automatically because of some 
dependencies in

the build system?

Fact is, that Apache Camel cannot be used on WAS 8 within a "real" OSGi
application based on the provided OSGi platform.

Indeed the solution could be to provide an own OSGi platform 
embedded in my

application. But this is not my favorite solution.

Thanks
Adam





--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-the-higher-OSGi-version-really-needed-tp5738924.html

Sent from the Camel - Users mailing list archive at Nabble.com.










Re: Dynamic route not started when OSGi bundle it is in is uninstalled and then reinstalled

2013-09-17 Thread Andreas Gies

Hi,

I am not sure we are looking at a Camel poblem. I am doing something 
similar in OSGi.
I listen to changes in a config directory. Any value changes gp into the 
Config Admin Service

and most of my routes are implemented as Managed Services.

As far as I can see config changes are picked up dynamically and bundle 
stop / restart does work.


This having said, in the beginning I was facing a slight problem with 
respect to recognize what file
had been changed reliably. Perhaps you have a similar problem - your 
config not being picked up in

a restart scenario ?

Best regards
Andreas

On 09/12/2013 10:31 PM, rodgersh wrote:

Hello -

I am using Camel v2.11.0.

I have a Camel dynamic route written in Java that is packaged in an OSGi
bundle deployed to Karaf v2.3.2. This route monitors a directory and when a
file is placed in the monitored directory the file is passed on to another
(custom) camel component. The bean containing this logic is defined in a
Spring XML file and the camel context injected into the bean.

Everything works fine when the OSGi container comes up initially. The bundle
with the dynamic camel route is installed by default, I place a file in the
monitored directory and everything works. If I then uninstall the bundle and
reinstall it (or if I stop/start my OSGi container), when the bundle comes
back up it loads the dynamic route but Camel does not seem to start the
route again.

Any ideas what I might be doing wrong?

Here is the Spring XML file, the Java code, and log output from my
application showing the bundle and its execution of the camel dynamic route.

Thanks -

Hugh


Spring XML file:


   
   
   
   
factory-pid="content.directorymonitor.ContentDirectoryMonitor"
 update-strategy="bean-managed" update-method="updateCallback">


 
   content.directorymonitor.DirectoryMonitor
 



 
 
 
 	


 
 
   



Java code:

public ContentDirectoryMonitor(final CamelContext camelContext)  {
 this.camelContext = camelContext;
 LOGGER.trace("ContentDirectoryMonitor constructor done");
 }

 public void init() {
 LOGGER.trace("INSIDE: init()");
 
 if (routeCollection != null) {

 try {
 // This stops the route before trying to remove it
 LOGGER.debug("Removing " + routeCollection.size() + "
routes");
 camelContext.removeRouteDefinitions(routeCollection);
 } catch (Exception e) {
 LOGGER.warn(e.getMessage());
 }
 }
 else {
 LOGGER.debug("No routes to remove before configuring a new
route");
 }
 
 configureCamelRoute();

 }

 private void configureCamelRoute()
 {
 LOGGER.trace("ENTERING: configureCamelRoute");
 
 RouteBuilder routeBuilder = new RouteBuilder()   {

 @Override
 public void configure() throws Exception  {
 String inbox = "file:" + monitoredDirectory +
"?moveFailed=.errors";
 inbox += "&delete=true";
 LOGGER.debug("inbox = " + inbox);

 from(inbox)
.setHeader(Request.OPERATION, constant("create"))
.setHeader(Request.DIRECTIVE, constant(directive))
.setHeader(Request.CONTENT_URI, constant(""))
.to("content:framework");  // our custom camel component
"content"
 }
 };
 
 try {

 // Add the routes that will be built by the RouteBuilder class
above
 // to this CamelContext.
 // The addRoutes() method will instantiate the RouteBuilder
class above.
 camelContext.addRoutes(routeBuilder);
 camelContext.start();
 
 // Save the routes created by RouteBuilder so that they can be

 // stopped and removed later if the route(s) are modified by the
 // administrator.
 this.routeCollection =
routeBuilder.getRouteCollection().getRoutes();
 }  catch (Exception e)  {
 LOGGER.warn("Unable to configure Camel route", e);
 }
 
 LOGGER.trace("EXITING: configureCamelRoute");

 }


Application's log output - in the "re-install" section you will see where
Camel says it started 0 of 0 routes, when for same bundle it started 1 route
when app was first started:


// User fills in form to create dynamic route

13:07:56,092 | TRACE | eb-f79294e88283) | ContentDirectoryMonitor  |
ymonitor.ContentDirectoryMonitor   50 | 186 - content-core-directorymonitor
- 2.3.0.SNAPSHOT | ContentDirectoryMonitor constructor done
13:07:56,095 | TRACE | eb-f79294e88283) | ContentDirectoryMonitor  |
ymonitor.ContentDirectoryMonitor  125 | 186 - content-core-directorymonitor
- 2.3.0.SNAPSHOT | INSIDE: setMonitoredDirectoryPath
13:07:56,095 | TRACE | eb-f

Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-10-03 Thread Andreas Gies

Hi,

it might be me, but I think your 2nd route is missing a to-element.
You need to do something with message like drop it to a file or at least 
log it.


Otherwise, like others have pointed out, using beans as payload is bad 
practice

in integration applications. However, you seem to be happy with that ...

Best regards
Andreas

On 09/30/2013 12:44 PM, kosalads wrote:

I have done a small app which connect to the camel war and do the processing
and set to another queue. However, when I process sample xml files it does
goes to the relevant queues and process. Unfortunately, when I use Bean
Object via camel It doesnt get updated in the 2nd queue.

If I explain bit more , This is how I have configured in the application
context which is in the camel war deployed in Jetty server.


 http://camel.apache.org/schema/spring";>
 
 
 
 
 

 
 
 

 
 http://camel.apache.org/schema/spring";>

 
 
 
 

I have crated three applications.

1. Standalone application which connect to the camel war and send the Pojo
Class to the Queue (inQ).
2. Camel war application which has above configuration. So when I pass the
Bean Object to the inQ it should send to the outQ
(Based on above configuration)
3. There is another application which reads the outQ and try to retrieve
Bean Object.

So what happens is that I could send the Pojo bean to the inQ but it doesnt
seems to be route to the outQ. So when I try to read from the outQ the queue
is empty.

Could you please let me know how we can handle above scenario and what is
the best way to handle this.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Camel with Multiple types of Endpoints

2013-10-11 Thread Andreas Gies

Hi,

the short answer is: Yes.

A bit more elaborate, I think that is a very common use case and kind of 
screams for

something like Camel - if not Camel itself ;)

What you would typically do is:

1) Implement a route that calls out to your core business logic. This 
route id your
service provisioning route. This route should be exposed using an 
"internal" endpoint.

I normally choose seda or jms endpoints for that.

2) Once you have done that you can use the route from other routes which 
I would call
the protocol routes. These would use the service implementation 
route and just perform

any protocol specific data mapping if required.

Best regards
Andreas

On 10/10/2013 07:23 PM, madhairsilence wrote:

Am having a service running in a Apache tomcat server. Am currently exposing
the service as  REST Service.

Now, we have decided to make it available for different types of clients.
Such that, the same service can be used as

1. Calling as REST Service
2. Pushing in a Queue
3. Call as Web Service
4. File/Multipart upload


and some other way mode of transport.

Can I have one single application, controlled by Camel , which can
understand all types of request and Route accordingly?

Can we achieve this!!!






--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-Multiple-types-of-Endpoints-tp5741306.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Camel with Multiple types of Endpoints

2013-10-11 Thread Andreas Gies

Hi,

I forgo to add, that for sanity reasons (at least of your ops guys) you 
want to run the
show inside a container. If that's a web container or an OSGi container 
is up to you.

Personally I prefer OSGi, but that's just my preference.

Running in a container definitely makes it easier to enable management 
access (in terms

of technical management, not your managers) for the routes you develop.

Definitely worth looking at http://hawt.io to see what you can get in 
that area.


Andreas

On 10/11/2013 11:22 AM, Andreas Gies wrote:

Hi,

the short answer is: Yes.

A bit more elaborate, I think that is a very common use case and kind 
of screams for

something like Camel - if not Camel itself ;)

What you would typically do is:

1) Implement a route that calls out to your core business logic. This 
route id your
service provisioning route. This route should be exposed using an 
"internal" endpoint.

I normally choose seda or jms endpoints for that.

2) Once you have done that you can use the route from other routes 
which I would call
the protocol routes. These would use the service implementation 
route and just perform

any protocol specific data mapping if required.

Best regards
Andreas

On 10/10/2013 07:23 PM, madhairsilence wrote:
Am having a service running in a Apache tomcat server. Am currently 
exposing

the service as  REST Service.

Now, we have decided to make it available for different types of 
clients.

Such that, the same service can be used as

1. Calling as REST Service
2. Pushing in a Queue
3. Call as Web Service
4. File/Multipart upload


and some other way mode of transport.

Can I have one single application, controlled by Camel , which can
understand all types of request and Route accordingly?

Can we achieve this!!!






--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-Multiple-types-of-Endpoints-tp5741306.html

Sent from the Camel - Users mailing list archive at Nabble.com.








Re: Help with Dynamic route

2013-10-11 Thread Andreas Gies

Hi,

if I understand correctly, you want to modify the multicast processor 
and add another branch to it

rather than adding another route to the camel context.

I had (a very brief) look at the MulticastProcessor. You can find the 
Javadoc at [1]


[1] http://camel.apache.org/maven/current/camel-core/apidocs/index.html

As far as I can see, there is no way to manipulate the Processor after 
it has been created.
Personally I would be reluctant to modify routes once they have been 
created. I prefer

shutting them down in order and recreate them.

In other words you would end up in Java DSL land and some kind of 
RouteFactory that'd create
routes. You need to keep track of the route created and can implement 
some recreation
logic in a listener to whatever events trigger the change to the list of 
recipients.


If the change occurs to frequently, I think you should reconsider as you 
don't want to
shutdown and recreate your routes all the time. If you have events that 
need distribution
to an unknown set of recipients, perhaps a JMS Topic would more serve 
the purpose ?


Perhaps you want to implement your own processor that allows dynamic 
registration

of endpoints to dispatch to ?

Just my 2ct
Andreas



On 10/11/2013 12:40 PM, gudiseashok wrote:

Hi I have a requirement, I want start some routes and leave them with
polling, after some time I want to add some more like that kind.


example










If I want to add another router dynamically to the multicast, like



.



is this possible if I add if i use dynamicroute configure ( ...from("")
to)
rouytebuilder.add routes to contact(camelcontext
like this?
Please advice...




--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-with-Dynamic-route-tp5741336.html
Sent from the Camel - Users mailing list archive at Nabble.com.



--


   Andreas Gies

WoQ -- Way of Quality UG

Geschäftsführer & CTO

/eMail:/andr...@wayofquality.de <mailto:andr...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)


/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)


/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)


/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


 Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.



 Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.


//


Re: Help with Dynamic route

2013-10-11 Thread Andreas Gies

Just noted, that I copied the wrong link in my answer earlier on.

[1] 
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/MulticastProcessor.html


Sorry for this
Andreas

On 10/11/2013 01:05 PM, Andreas Gies wrote:

Hi,

if I understand correctly, you want to modify the multicast processor 
and add another branch to it

rather than adding another route to the camel context.

I had (a very brief) look at the MulticastProcessor. You can find the 
Javadoc at [1]


[1] http://camel.apache.org/maven/current/camel-core/apidocs/index.html

As far as I can see, there is no way to manipulate the Processor after 
it has been created.
Personally I would be reluctant to modify routes once they have been 
created. I prefer

shutting them down in order and recreate them.

In other words you would end up in Java DSL land and some kind of 
RouteFactory that'd create
routes. You need to keep track of the route created and can implement 
some recreation
logic in a listener to whatever events trigger the change to the list 
of recipients.


If the change occurs to frequently, I think you should reconsider as 
you don't want to
shutdown and recreate your routes all the time. If you have events 
that need distribution
to an unknown set of recipients, perhaps a JMS Topic would more serve 
the purpose ?


Perhaps you want to implement your own processor that allows dynamic 
registration

of endpoints to dispatch to ?

Just my 2ct
Andreas



On 10/11/2013 12:40 PM, gudiseashok wrote:

Hi I have a requirement, I want start some routes and leave them with
polling, after some time I want to add some more like that kind.


example










If I want to add another router dynamically to the multicast, like



.



is this possible if I add if i use dynamicroute configure ( ...from("")
to)
rouytebuilder.add routes to contact(camelcontext
like this?
Please advice...




--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-with-Dynamic-route-tp5741336.html

Sent from the Camel - Users mailing list archive at Nabble.com.





--


   Andreas Gies

WoQ -- Way of Quality UG

Geschäftsführer & CTO

/eMail:/andr...@wayofquality.de <mailto:andr...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)


/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)


/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)


/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


 Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.



 Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.


//


Re: Help to re-write route

2013-10-11 Thread Andreas Gies

AehmAre you asking how to get your route into its own class
so that you could use it in a container ?

Andreas

On 10/11/2013 01:22 PM, richie.rivi...@gmail.com wrote:

Hi guys,

I was wondering if someone could give me some help out how to re-write this
camel test into a proper camel program. The issue is I know how to write a
simple route and then execute it. But after the route is executed and I want
to grab the parsed xml in a fashion similar to testStaxExpression how would
I do this in a real Camel application. I know the configure method in the
route is not the right place to do it.

Where is the right place. Sorry for the easy questions. I am a beginner.



package org.apache.camel.component.stax;

import org.apache.camel.EndpointInject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.stax.model.Record;
import org.apache.camel.component.stax.model.RecordsUtil;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.apache.camel.component.stax.StAXBuilder.stax;

public class StAXJAXBIteratorExpressionTest extends CamelTestSupport {
 @EndpointInject(uri = "mock:records")
 private MockEndpoint recordsEndpoint;

 @BeforeClass
 public static void initRouteExample() {
 RecordsUtil.createXMLFile();
 }

 @Override
 public RouteBuilder createRouteBuilder() {
 return new RouteBuilder() {
 @Override
 public void configure() throws Exception {
log.info("Doing route");
 // START SNIPPET: e1
 from("file:target/in")
 // split the file using StAX (the stax method is from
StAXBuilder)
 // and use streaming mode in the splitter
 .split(stax(Record.class)).streaming()
 .to("mock:records");
 // END SNIPPET: e1
 }
 };
 }

 @Test
 public void testStaxExpression() throws InterruptedException {
 recordsEndpoint.expectedMessageCount(10);
 recordsEndpoint.allMessages().body().isInstanceOf(Record.class);

 recordsEndpoint.assertIsSatisfied();

 Record five =
recordsEndpoint.getReceivedExchanges().get(4).getIn().getBody(Record.class);
 assertEquals("4", five.getKey());
 assertEquals("#4", five.getValue());
 }
}




--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-to-re-write-route-tp5741339.html
Sent from the Camel - Users mailing list archive at Nabble.com.



--


   Andreas Gies

WoQ -- Way of Quality UG

Geschäftsführer & CTO

/eMail:/andr...@wayofquality.de <mailto:andr...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)


/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)


/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)


/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


 Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.



 Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.


//


Re: Help with Dynamic route

2013-10-11 Thread Andreas Gies

Hi again,

this comes from one of my test classes:

  @Test
  public void assortmentTest() throws Exception {

final String country = getTestProperties().getProperty("country");
final String location = 
headerLocation(getTestProperties().getProperty("location"));


CamelTestSupport cts = getCamelTestSupport();

MockEndpoint mock = cts.wireMock("assortmentOut", 
"activemq:topic:kaufland/store/device/scale/assortment");

mock.setExpectedMessageCount(1);
mock.expectedHeaderReceived(HeaderProcessor.PROP_LOCATION, location);
mock.expectedHeaderReceived(HeaderProcessor.PROP_COUNTRY, country);
mock.expectedHeaderReceived(HeaderProcessor.PROP_QUALIFIED_ID, 
country + location);


cts.getContext().start();

cts.sendTestMessage("/testMessage.xml",
  "ResourceType=Msg2TopicScaleAssortment", 
"activemq:queue:XPDinteg_DeviceClientFromQ");

mock.assertIsSatisfied(2000l);

String missingHeaderNames = 
getMissingHeaderNames(mock.getExchanges().get(0), new String[] { 
"DestinationPath" });


Assert.assertEquals("Message is missing headers [" + 
missingHeaderNames.toString() + "]", "", missingHeaderNames);


  }

A few things to note:

CamelTestSupport is a helper class I have created for my test suite that 
simply creates a camel context and injects the required components.
I have decided to do it that way as I use quite a number of components 
for my integration tests and I like it encapsulated.


cts.sendMessage(...) pretty much reads a hermes message definition and 
creates a camel exchange to be sent. I am using that to test with
real business messages and my users use hermes to grab and store those. 
You can replace that call with a normal producer call to send a

message.

The rest of the code is more or less plain Camel plus a bit of custom 
chaecking for expected headers.



Hope that helps
Andreas



On 10/11/2013 04:05 PM, gudiseashok wrote:

Hi Muller,

I am afraid, basically the solution you have provided is for "Routing", in
order to do this I have to add when ever I found new server then can call
for routing - Which is basically decisions based.

But my thing is , I need to have a main route which kick-off other "Routes"
(which are meant to start ones and run forever with polling), so when I add
another route like this, I am considering the additional one to be added for
existing routes (which are already running on multicast fashion)

say like




...



so when I add another one I want those to be added to the multicast list,
because I cant affort this to happen sequential manner ... because It doesnt
need to be wait for other routes.

But I remember you also have suggested JMS topic solution to one of the folk
who was having similar issue , while I was searching on this topic. Could
you please provide if you have a JMS topic to - add routeTo existing
TestClass or psuedo code thought also fine.

Thanks for taking time to respond Muller,


Regards
Ashok Gudise



--
View this message in context: 
http://camel.465427.n5.nabble.com/Help-with-Dynamic-route-tp5741336p5741359.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Camel use case with Akka

2014-10-28 Thread Andreas Gies
Hi Gordon 

I am using Akka in Combination with Camel within a distributed Retail 
application.
All application parts run on top of Karaf. So far I think, the combination of 
those 
technologies is a good choice with respect to scalability and testability. 

I had used Akka in other applications before and was reasonably happy with it 
and therefore I have not spent much time 
with researching alternatives. 

Best regards
Andreas

> On 28 Oct 2014, at 16:26, gmh  wrote:
> 
> All,
> I am trying to investigate Akka and camel 
> Our use case is as follows:
> 
> Subscribe to websocket queue and retrieve json from the queue
> process each json thru Camel routes (atomically) 
> assume large amount of data 
> 
> What would the appropriate design as far as fail over/
> dristributed/threading is concerned?
> I am concerned that since Camel is single threaded(?) that we will not be
> able to process a huge amount of data in a timely fashion.
> What have your experiences been?
> Is Akka a good choice? Any other options?
> Gordon
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-use-case-with-Akka-tp5758237.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel with OSGI in Felix with Spring DSL

2017-03-03 Thread Andreas Gies

Hi there,


for what it's worth - we are using Camel in OSGi with a non-karaf 
container.

However - we are not using Spring.

First, our container is completely written in Scala and therefor we are 
using

different config mechanisms. Secondly, we prefer a programmatic creation
of our Camel Contexts in order to leverage the compiler telling us
when we do something wrong.

Our underlying framework is felix, but we also do have quite some 
infrastructure

bundles to make everything work.

For reference, you might want to look at
https://github.com/woq-blended/blended

https://github.com/woq-blended/blended/tree/master/blended.camel.utils

https://github.com/woq-blended/blended/tree/master/blended.samples/blended.samples.camel

Best regards
Andreas

On 03/03/17 13:21, Claus Ibsen wrote:

See the examples there is a spring-dm example that runs in Karaf.
https://github.com/apache/camel/tree/master/examples

The spring-dm example is at
https://github.com/apache/camel/tree/master/examples/camel-example-spring-dm

Running Camel with bare bone Felix is not really recommended /
supported. You need to use karaf based containers for that.

If not you need mor manual coding / setup yourself which we do not
recommend / support.


On Fri, Mar 3, 2017 at 1:12 PM, kumar  wrote:

Hi ,

I am new to OSGI world.

I spent lot of time (even days ) in searching/understanding camel-spring
with osgi container. I didn't find a good article for begginer like me which
works straightforward with some setup or github..etc.

We are having camel-spring application running well. Now we want to move to
OSGI bundle environment like Felix(Karaf ..also).
We are doing some work on migration to OSGI, we are having severe issues we
were able to solve couple of them ,but end up with having  below issues:

1. I dont know where to place camel-spring xml context and route  files
(previuosly in classpath with NON-OSGi) .So its not loading context getting
file not found .

2. if I put that as below , i know its may be a wrong way

*ClassPathXmlApplicationContext appContext = new
ClassPathXmlApplicationContext(
 new String[] {"file:app-camel-spring.xml" });*
*Exception:*
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://camel.apache.org/schema/spring]
Offending resource: URL [file:app-camel-spring.xml]

 at
org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70)
 at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
 at
org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
 at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:301)
 at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1408)
 at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)
 at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:172)
 at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:142)
 at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
 at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
 at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
 at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
 at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
 at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
 at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
 at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
 at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
 at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
 at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
 at
org.springframework.c

Re: Camel with Karaf + Blueprint

2017-03-07 Thread Andreas Gies

Hi,

from your description it sounds that haven't exported the instances

you would like to access as services. It is not sufficient to export the 
packages.


The instances that shall be available in other bundle must be exported as

services and then they can be referenced as service in your context.

As I am not using Blueprint anymore, my memory is a bit dusty on

the syntax, but if you look for service export and service reference

in the blueprint doc you should be fine.


You might want to read up on OSGi services in general to understand

how services can be exposed and referenced with user defined properties

to make sure you get the right instance (in case you have more than

one instance of a particular service).


Hope that helps

Andreas


On 07/03/17 18:50, kumar wrote:

Hi ,

I am trying to use Camel(2.18.2) + karaf(4.0.8)+blueprint(Aries) for my
migration as suggested by experts.

Now I am able to load all my bundles but unable to start Camel context due
to following errors:

1. I have 4 xml files. first one is root file
2. seconnd, third , four are routes and beans files(Routes aand beans are in
different files)
3. These Camel Blueprint DSL route beans are not able to access beans inside
bundle A
4. I am trying to load all xml files as separate bundle named -"Conf"

Somehow Conf bundle not able to access/ load beans from other active bundles
in Karaf Container.

Please help me on how to load beans from other bundles.

I did export all packges from other bundles.

Thanks,
Kumar




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-Karaf-Blueprint-tp5795036.html
Sent from the Camel - Users mailing list archive at Nabble.com.