Re: Apache Documentation - Code snippets missing

2015-06-29 Thread alexis.jacquemart
The same ! The script balise is at display : none for each code snippets.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Documentation-Code-snippets-missing-tp5768660p5768667.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Multiple Camel contexts and request to multiple replies communication pattern (multicast)

2015-06-29 Thread hasikada
Hello,

I work on the ESB (entiprise service bus) project based on Apache Camel
running on Apache Karaf. The ESB provides several different services, Each
service provides REST API (e.g TestRest), service routes (e.g TestService)
and service beans (e.g TestBean). The service classs contains one CXFRS
route that delivers a REST request to an appropriate service route. Each
service is implemented as OSGI bundle. But currently the bundles are not
independent on each other. There is only one blueprint configuration for all
beans from all service bundles with only one Camel context. I plan to
refactor to situation where each service bundle has own blueprint and Camel
context. It raises question how to communicate between multiple independent
Camel Contexts. The JMS would be a possibility, but I need one request to
multiple replies pattern.

For example, I implemented the integrity check service (CheckService). The
service requests an integrity check on the other services (e.g MapService,
MediaService, NetworkService, etc).

// CheckService

from(cxfrs:bean:checkServer?resourceClass=CheckServicebindingStyle=SimpleConsumer)
.recipientList(simple(direct:${header.operationName}));

from(direct:checkServices)
.multicast().aggregationStrategy(new 
ListAggregatorServiceResponse())
.to(
direct:checkMapService,
direct:checkMediaService,
direct:checkNetworkService
)
.end();

So, when an ESB client sends a REST request, CheckService needs to call each
integrity check service route over all known service bundles.

It would be nice if CheckService provides well known queue for the intergity
check requests. Any service bundle with integrity check implementation would
consumes request from the queue.

// Check Service
from(direct:checkServices)

.to(jms.integrityCheckRequests);

// MapService
from(jms:integrityCheckRequests).to(direct:checkMapService);

// MediaService
from(jms:integrityCheckRequests).to(direct:checkMediaService);

A ESB client sends the REST request for integrity check and expects the
aggregated check service result in the response.
It raises another question how to aggregate responses in
'direct:checkServices' route. Using request-reply messaging (InOut) in JMS
is not probably solution. Create another aggregation queue for responses
from services is not solution also due to asynchronous nature, as a client
expects result in REST request response.

Maybe the invert solution would work. Each service bundle registers its JMS
endpoint for integrity check to common database. The Check service reads
endpoints from the database and invoke them in request-reply manner.

from(direct:checkServices)

.recipientList(header(recipients)).aggregationStrategy(new
ListAggregatorServiceResponse());

Please, do you have any better idea?

Adam




--
View this message in context: 
http://camel.465427.n5.nabble.com/Multiple-Camel-contexts-and-request-to-multiple-replies-communication-pattern-multicast-tp5768668.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel XML Simple problem using operators?

2015-06-29 Thread Claus Ibsen
Hi

Try upgrading Camel.

On Mon, Jun 29, 2015 at 1:00 PM, rory rory.tor...@intel.com wrote:
 I'm using Camel 2.10.

 I'm using org.apache.camel.model.RouteDefinition.

 I can set the body of my request fine using the variables described in the
 docs:

 http://camel.apache.org/simple.html

 For example, if I create a org.apache.camel.model.RouteDefinition which
 looks like:

  // Calling toString on RouteDefinition
 Route[[From[direct:postScript]] -
 [SetBody[simple{$simple{in.header.num}}]]]

 Then it will correctly set the body to whatever in.header.num is, for
 example 5.

 However, whenever I try to evaluate expressions using the operators listed
 in the docs:

 http://camel.apache.org/simple.html

 Nothing seems to be happening. For example, say in.header.num is 5, then I
 would expect the following to set the body to 'true' since
 $simple{in.header.num} == 5 is true, but instead the body is being set to
 'false':

 // Calling toString on RouteDefinition
 Route[[From[direct:postScript]] - [SetBody[simple{$simple{in.header.num} ==
 5}]]]

 I see the same problems using the other operators like '!=', 'contains' and
 'in'.

 Note, I'm creating my RouteBuilder instances like so:

 final RouteDefinition rd = ModelHelper.createModelFromXml(xml,
 RouteDefinition.class);

 Where the 'xml' String looks like:

 ?xml version=1.0 encoding=UTF-8 standalone=yes?route
 id=PostScript xmlns=http://camel.apache.org/schema/spring;from
 uri=direct:postScript/setBodysimple
 resultType=java.lang.Boolean$simple{in.header.num} ==
 4/simple/setBody/route

 Any help is much appreciated!




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-XML-Simple-problem-using-operators-tp5768659.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


RE: Configure ActiveMQ queue forwarding based on wildcard destinations

2015-06-29 Thread elrick.dutoit
Hi Claus,

I see to have arrive at a solution:


route
from 
uri=ActiveMQ1:queue:queue.test./
recipientList

simpleActiveMQ2:${header.JMSDestination}/simple
/recipientList
/route

From my initial testing this will listen on all queues starting with 
queue.test on instance 1 and forward incoming messages to a similarly named 
queue on instance 2.

Thank you for all the pointers.

Regards,
Elrick


From: Du Toit, Elrick WE
Sent: 2015/06/25 08:35
To: 'Claus Ibsen-2 [via Camel]'
Subject: RE: Configure ActiveMQ queue forwarding based on wildcard destinations

Thanks.

I will have a look at the resources you listed.

I guess you still need to provide a dummy to element as part of the route, 
but by setting the CamelJMSDestination header this will actually override the 
producer endpoint?

Regards

From: Claus Ibsen-2 [via Camel] 
[mailto:ml-node+s465427n5768563...@n5.nabble.com]
Sent: 2015/06/25 08:23
To: Du Toit, Elrick WE
Subject: Re: Configure ActiveMQ queue forwarding based on wildcard destinations

Hi

Yes.

You can set a header from the spring xml dsl,

setHeader name=CamelJmsDestination
   simplefoo-${header.someName}/simple
/setHeader

And use the simple language to build the string value using dynamic tokens.
http://camel.apache.org/simple

And for more powerful languages you can use groovy, mvel etc
http://camel.apache.org/languages.html

You can use simple / languages in the recipient list as well. Its all
the same in Camel, an Expression (or Predicate).

On Wed, Jun 24, 2015 at 1:54 PM, elrick.dutoit
[hidden email]/user/SendEmail.jtp?type=nodenode=5768563i=0 wrote:

 Hi Claus,

 Thank you for the response.

 I have read through the resources pointed out, but I guess I am just too new 
 to Camel to really understand how use these features to achieve my desired 
 outcome.

 Since I am attempting to use the Camel instance embedded into ActiveMQ, it 
 seems that I only have the Spring method for setting up routes. If there was 
 an easy way in which the CamelJMSDestinationName could be set to the incoming 
 queue name, just on the different ActiveMQ instance by just using the Spring 
 environment, it would have been great. But herein lays two challenges:

 * Getting to the incoming queue name (maybe from an existing header?)

 * Dynamically concatenating the destination ActiveMQ name and queue 
 name and assigning it to the destination (maybe using recipientlist with 
 single element).

 I will be spending some more time getting to know Camel better, and hopefully 
 I will arrive at an acceptable solution.

 Regards

 From: Claus Ibsen-2 [via Camel] [mailto:[hidden 
 email]/user/SendEmail.jtp?type=nodenode=5768563i=1]
 Sent: 2015/06/22 16:23
 To: Du Toit, Elrick WE
 Subject: Re: Configure ActiveMQ queue forwarding based on wildcard 
 destinations

 Hi

 The dynamic to in Camel is this FAQ / eip
 http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

 You can also set a header to reuse, see section _Reuse endpoint and
 send to different destinations computed at runtime_ at
 http://camel.apache.org/jms

 On Mon, Jun 22, 2015 at 4:02 PM, elrick.dutoit
 [hidden email]/user/SendEmail.jtp?type=nodenode=5768472i=0 wrote:

 Good day,

 I am very new to Camel and ActiveMQ. I have configured two ActiveMQ
 instances and would like to use Camel to forward queue messages from the one
 instance to the other using the same queue names. I would like to configure
 this using wildcards, basically something like:

 from=ActiveMQ1:queue:queue.test.
 to=ActiveMQ2:queue:queue.test.

 When a message is published to the queue queue.test.queuename1 on instance
 ActiveMQ1, it must be forwarded to a similarly named queue
 (queue.test.queuename1) on instance ActiveMQ2.

 I know it is possible to define each (queue) route one for one, but was
 hoping that it would be possible to use a wildcard in the destination, or
 somehow construct the destination dynamically to match the name of the
 actual from queue name.
 Camel did accept the  wildcard in the to portion of the route, but then
 all messages ended up in a queue called queue.test. on ActiveMQ2.


 Regards




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Configure-ActiveMQ-queue-forwarding-based-on-wildcard-destinations-tp5768470.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email]/user/SendEmail.jtp?type=nodenode=5768472i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/

 
 If you reply to this email, your message will be added to 

Camel XML Simple problem using operators?

2015-06-29 Thread rory
I'm using Camel 2.10.

I'm using org.apache.camel.model.RouteDefinition.

I can set the body of my request fine using the variables described in the
docs:

http://camel.apache.org/simple.html

For example, if I create a org.apache.camel.model.RouteDefinition which
looks like:

 // Calling toString on RouteDefinition
Route[[From[direct:postScript]] -
[SetBody[simple{$simple{in.header.num}}]]]

Then it will correctly set the body to whatever in.header.num is, for
example 5.

However, whenever I try to evaluate expressions using the operators listed
in the docs:

http://camel.apache.org/simple.html

Nothing seems to be happening. For example, say in.header.num is 5, then I
would expect the following to set the body to 'true' since
$simple{in.header.num} == 5 is true, but instead the body is being set to
'false':

// Calling toString on RouteDefinition
Route[[From[direct:postScript]] - [SetBody[simple{$simple{in.header.num} ==
5}]]]

I see the same problems using the other operators like '!=', 'contains' and
'in'.

Note, I'm creating my RouteBuilder instances like so:

final RouteDefinition rd = ModelHelper.createModelFromXml(xml,
RouteDefinition.class);

Where the 'xml' String looks like:

?xml version=1.0 encoding=UTF-8 standalone=yes?route
id=PostScript xmlns=http://camel.apache.org/schema/spring;from
uri=direct:postScript/setBodysimple
resultType=java.lang.Boolean$simple{in.header.num} ==
4/simple/setBody/route

Any help is much appreciated!




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-XML-Simple-problem-using-operators-tp5768659.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Dynamic Cron values for starting a route

2015-06-29 Thread contactreji
Hi 

I have some route like

route
camel:from
uri=quartz://consumptionData/NTT?cron={{NTTConsumptionScheduler}}amp;startDelayedSeconds=10amp;trigger.timeZone=JST
/

..
..
.
/route

Now I have a new requirement where the cron expression needs to be changed
dynamically. Or let me put it this way.. Based on some condition I might
need to have the scheduler fired every 1 min and once the state changes. By
default its 10 mins and the cron for the same is picked up from the
properties.

Is there a way?

Regards
Reji



-
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel  
Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-Cron-values-for-starting-a-route-tp5768655.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel website is not showing the code blocks

2015-06-29 Thread Daniel Kulp
Hmm… looks like they updated confluence and the new version has changed a bunch 
of the class names for various elements.That’s causing issues with the 
scripts for the code formatters, but there are also CSS issues due to the 
changed class names.   Looking at it now.

Dan



 On Jun 29, 2015, at 1:48 AM, xlogger xloggers...@gmail.com wrote:
 
 I tried with a few different browsers on my PC (Firefox, Chrome, and IE..)
 but found that the code blocks in all the Camel web pages are not displaying
 properly... it looks like they are all collapsed... It was Okay last week
 when I browse around
 
 E.g.
 http://camel.apache.org/content-based-router.html
 http://camel.465427.n5.nabble.com/file/n5768644/Apache_Camel_Content_Based_Router_-_Mozilla_Firefox_2015-06-29_13-44-32.png
  
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-website-is-not-showing-the-code-blocks-tp5768644.html
 Sent from the Camel - Users mailing list archive at Nabble.com.

-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com



Re: Iterate in sql result list

2015-06-29 Thread renato_natos
Hi, 

I tried but dont work.

My problem occur when the camel try convert to Map. 

Once the camel convert to List and after the camel try convert to Map and
then shows the message:

Cannot convert InputStream to java.util.Map



--
View this message in context: 
http://camel.465427.n5.nabble.com/Iterate-in-sql-result-list-tp5768597p5768669.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: How to follow redirect url from server with http4 in camel ?

2015-06-29 Thread dilipkumar19
Hi Optixpro,

did you find a solution for this ??
I am stuck with a similar problem but with https url.
the base url get s authenticated sucessfully and creates an url with token
but redirect fails






--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-follow-redirect-url-from-server-with-http4-in-camel-tp5731967p5768671.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Wiki pages not displaying all content?

2015-06-29 Thread Mark Frazier
Anybody know what is up with the Camel wiki pages? They are not displaying the 
example (source code) content
in Safari, Firefox, or Chrome for me right now.

The content is actually there when “view page source” though.

???

multiple insert-where-filter not exists

2015-06-29 Thread lilw
Hello, 
I'm doing a bulk load where I have a case for the following insertion:
INSERT {...} 
WHERE { 
 FILTER NOT EXISTS{ ?s dc:identifier ${pair.getKey()}^^xsd:int.}
}
In this bulk load I can have up to 50 of these insert/where clauses,
separated by a semi-colon. Through testing, it appears that this type of
insertion is noticeably slower than delete/insert in the following format: 
DELETE{ }WHERE{?s dc:identifier ${pair.getKey()}^^xsd:int. };
DELETE{ }WHERE{?s dc:identifier ${pair.getKey()}^^xsd:int. };
DELETE{ }WHERE{?s dc:identifier ${pair.getKey()}^^xsd:int. };
INSERT{
...many objects...
}

I haven't worked a long time with sparql query, and not sure if this
observation can make sense. Also, it appears that when I have 50 of
INSERT/WHERE clauses posted to sesame server simultaneously, every one of
them is still treated as a  separate transaction. Is there a way of doing
these inserts for all 50 insert/where clauses to be posted in a single
transaction into sesame?

Thank you for your time.



--
View this message in context: 
http://camel.465427.n5.nabble.com/multiple-insert-where-filter-not-exists-tp5768688.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: File2: readLock/ready file alternatives

2015-06-29 Thread jamesburn
Hi Claus

Thanks for the tips. TRACE logging did help see the innards of what was 
happening with the Readlock. I'm also embarrassed to admit that it was my 
file-browser which wasn't refreshing the filesize hence I thought the files 
weren't being completely copied!
I now see they are - Camel File2 ReadLock is working fine and am happy with the 
ability to tune the ReadLock timeouts.

Thanks for your help and Camel in general.

James

From: Claus Ibsen-2 [via Camel] 
[mailto:ml-node+s465427n5768503...@n5.nabble.com]
Sent: 23 June 2015 14:34
To: BURN, James
Subject: Re: File2: readLock/ready file alternatives

Hi

Maybe try with longer timeout values.

You can enable DEBUG/TRACE logging on
org.apache.camel.component.file.strategy to see what it logs

The code is
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java

On Tue, Jun 23, 2015 at 3:06 PM, jamesburn [hidden 
email]/user/SendEmail.jtp?type=nodenode=5768503i=0 wrote:

 Hi

 Thanks Claus for your prompt response!

 I did try readLock=changed first:
 from 
 uri=file:/mnt/DEVELOPMENT?delete=trueamp;localWorkDirectory=/tmpamp;include=.*amp;readLock=changedamp;readLockTimeout=2amp;readLockCheckInterval=7000/

 but am still getting incomplete files delivered (mostly).

 I can see a zero byte .camelLock file written whilst the file is being 
 collected.  Can I monitor what is actually happening with readLock whilst it 
 is working?

 Cheers

 James

 From: Claus Ibsen-2 [via Camel] [mailto:[hidden 
 email]/user/SendEmail.jtp?type=nodenode=5768503i=1]
 Sent: 23 June 2015 13:46
 To: BURN, James
 Subject: Re: File2: readLock/ready file alternatives

 Hi

 There is a readLock=change that check for file size / date
 modifications over a time window

 On Tue, Jun 23, 2015 at 2:25 PM, BURN, James [hidden 
 email]/user/SendEmail.jtp?type=nodenode=5768500i=0 wrote:

 Hi

 I'm using Camel 2.13.2 on a Linux VM to collect/process files on a Windows 
 server.

 This is done with a Linux filemount onto a folder on the Windows server.

 The issue we're getting is large (37Mb) files are often collected incomplete.

 I tried using the readLock, as per:
 from 
 uri=file:/mnt/DEVELOPMENT?delete=trueamp;localWorkDirectory=/tmpamp;include=.*amp;readLock=renameamp;readLockTimeout=2amp;readLockCheckInterval=7000/

 however, this didn't work and I can understand that perhaps the Windows 
 filelock methods are not supported (as per readLock notes in 
 http://camel.apache.org/file2.html)

 I also tried fileLock=rename, but again ended up with an incomplete file.

 Getting a ready file written after the data file isn't an option as we 
 have no access to the script which writes the data files.

 Are there any other tricks we can use here. I'm wondering (and this is what 
 I thought readLock did when I first found it) whether my Camel route can 
 poll any new files for xx seconds to see if a file has stopped increasing in 
 size. If so then it is collected. Is this what exclusiveReadLockStrategy 
 would allow? If so, how to I set this up?

 Thoughts most welcome.

 Thanks

 James


 Oxford University Press (UK) Disclaimer

 This message is confidential. You should not copy it or disclose its 
 contents to anyone. You may use and apply the information for the intended 
 purpose only. OUP does not accept legal responsibility for the contents of 
 this message. Any views or opinions presented are those of the author only 
 and not of OUP. If this email has come to you in error, please delete it, 
 along with any attachments. Please note that OUP may intercept incoming and 
 outgoing email communications.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email]/user/SendEmail.jtp?type=nodenode=5768500i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 hawtio: http://hawt.io/
 fabric8: http://fabric8.io/

 
 If you reply to this email, your message will be added to the discussion 
 below:
 http://camel.465427.n5.nabble.com/File2-readLock-ready-file-alternatives-tp5768499p5768500.html
 To start a new topic under Camel - Users, email [hidden 
 email]/user/SendEmail.jtp?type=nodenode=5768503i=2mailto:[hidden 
 email]/user/SendEmail.jtp?type=nodenode=5768503i=3
 To unsubscribe from Camel - Users, click here
 NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

 Oxford University Press (UK) Disclaimer

 This message is confidential. You should not copy it or disclose its contents 
 to anyone. You may use and apply the information for the intended purpose 
 only. OUP 

Apache Documentation - Code snippets missing

2015-06-29 Thread contactreji
Hi

Just found that code snippets are missing in Apache Camel documentations.
What could be the reason? 
Is it same with everyone or is it something wrong with my system?

http://camel.465427.n5.nabble.com/file/n5768660/codemissing.jpg 

Cheers
Reji



-
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel  
Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Documentation-Code-snippets-missing-tp5768660.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Wiki pages not displaying all content?

2015-06-29 Thread Nathan Jones
Yeah I posted the same question yesterday. The following Greasemonkey
script fixes the issue for me:

// ==UserScript==
// @nameCamel Code Snippets
// @namespace   ncjones
// @include https://camel.apache.org/*
// @version 1
// @grant   none
// ==/UserScript==

document.getElementsByClassName('codeContent').forEach(function(codeDiv) {
  var script = codeDiv.querySelector('script');
  var oParser = new DOMParser();
  var oDOM = oParser.parseFromString('p' + script.innerHTML + '/p',
text/xml);
  var codeText = oDOM.childNodes[0].childNodes[0].textContent;
  codeDiv.innerHTML = 'pre' + codeText + '/pre';
});

On 30/06/15 03:50, Mark Frazier wrote:
 Anybody know what is up with the Camel wiki pages? They are not displaying 
 the example (source code) content
 in Safari, Firefox, or Chrome for me right now.
 
 The content is actually there when “view page source” though.
 
 ???
 


RE: route specification in web.xml

2015-06-29 Thread Hans Orbaan
Hi,

Apparently all code snippets on camel.apache.org are invisible at the moment. I 
think it is a syntax highlighter issue.
You can still look up the code in the page source. Just right click and view 
page source

-Oorspronkelijk bericht-
Van: Tim Dudgeon [mailto:tdudgeon...@gmail.com] 
Verzonden: Sunday 28 June 2015 11:43
Aan: users@camel.apache.org
Onderwerp: Re: route specification in web.xml

Thanks. That's what I need.
But are you aware that all the code snippets are missing from that page?

Tim


On 27/06/2015 09:30, Claus Ibsen wrote:
 Hi

 Yes there is more documentation here
 http://camel.apache.org/servletlistener-component.html

 On Thu, Jun 25, 2015 at 1:40 PM, Tim Dudgeon tdudgeon...@gmail.com wrote:
 I was trying to get some servlets working, based on the 
 camel-example-servlet-tomcat-no-spring example.

 I'm a bit confused by this section:

 context-param
  param-namerouteBuilder-MyRoute/param-name
  !-- define the routes as a resource from the classpath by 
 prefixing the value with classpath: --
  !-- note: instead of using a XML file we can also define the 
 routes in Java code in a RouteBuilder class -- 
 param-valueclasspath:camel-config.xml/param-value
/context-param

 I worked out by trial and error how to specify an individual 
 RouteBuilder implementation as a Java class:
 param-valuefoo.bar.bazMyRouteBuilderClass/param-value

 and how to do a package scan for multiple RouteBuilders:
 param-valuepackagescan:foo.bar.baz/param-value

 But is there and more detailed information on this sort of thing anywhere?

 For instance, what other options are available here, and if you 
 needed to run multiple camel contexts (separate servlets?) how could you do 
 this.

 Thanks
 Tim





Camel 2.14/Netty: How to add ByteArrayDecoder to ServerChannelPipeline?

2015-06-29 Thread SteveR
I have a linux Java7 stand-alone application using Camel 2.14 and the
camel-netty component. I have a route that receives via netty:udp and then
attempts to mirror the received packets also via netty:udp. I'm also using
the *LengthFieldBasedFrameDecoder *to decode the UDP packets into message
frames based on a 2-byte length field within each UDP message.

The UDP messages I'm receiving contain certain characters that don't decode
in UTF-8 (e.g. 0xa1 0xb2, 0xc3 ), so I've been trying to use the
*iso-8859-1* charset. I'm thinking that what I want in my
ServerPipelineFactory subclass is the
*io.netty.handler.codec.bytes.ByteArrayDecoder*, but I'm unable to get it to
compile with the *addlast()* method.

I've been using the approach outlined  here
https://github.com/apache/camel/blob/master/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyCustomPipelineFactorySynchTest.java
 
thus far, but then I run into this compile issue with *io.netty *versus
*org.jboss.netty*.

Which leads me to believe that I'm confused wrt imports for *io.netty*
versus *org.jboss.netty*?  Below is my extended *ServerPipelineFactory
*class which I'd like to switch the StringDecoder/StringEncoder for
ByteArrayDecoder/ByteArrayEncoder.

Any help is greatly appreciated!

  Thanks, SteveR


package multiprotocollistenerrouter;

//import io.netty.handler.codec.bytes.ByteArrayDecoder;
//import io.netty.handler.codec.bytes.ByteArrayEncoder;
//import io.netty.channel.ChannelPipeline;
//import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

import io.netty.util.CharsetUtil;
import org.apache.camel.component.netty.NettyConsumer;
import org.apache.camel.component.netty.ServerPipelineFactory;
import org.apache.camel.component.netty.handlers.ServerChannelHandler;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;

//import org.jboss.netty.handler.logging.LoggingHandler;
//import org.jboss.netty.logging.InternalLogLevel;

import org.slf4j.Logger;// The org.slf4j.Logger interface is the
main user entry point of SLF4J API.
import org.slf4j.LoggerFactory; // Utility class producing Loggers for
various logging APIs, most notably for log4j.

/**
 * Consumer linked channel pipeline factory for the MCQ source provider.
 * Provides custom support for reception/parsing/processing of MCQ.
 *
 * @author steve
 *
 * @see http://camel.apache.org/netty.html
 * @see
http://opensourceknowledge.blogspot.com/2010/08/customizing-netty-endpoints-using.html#
 * @see
http://seeallhearall.blogspot.com/2012/06/netty-tutorial-part-15-on-channel.html
 * @see
https://github.com/apache/camel/blob/master/components/camel-netty/src/test/
 * 
java/org/apache/camel/component/netty/NettyCustomPipelineFactorySynchTest.java
 */
public class McqServerPipelineFactory extends ServerPipelineFactory  {
private final static Logger logger   =
LoggerFactory.getLogger(McqServerPipelineFactory.class);
private static final String NEW_LINE =
System.getProperty(line.separator);

// ---
// Stateless, singleton handler instances...re-used across connections
// ---
private static final ChannelHandler STR_ENCODER = new
StringEncoder(CharsetUtil.ISO_8859_1);
private static final ChannelHandler STR_DECODER = new
StringDecoder(CharsetUtil.ISO_8859_1);

//private static final ChannelHandler LOG_HANDLER = new
LoggingHandler(InternalLogLevel.INFO);

//private static final ByteArrayDecoder BYTES_DECODER = new
ByteArrayDecoder();
//private static final ByteArrayEncoder BYTES_ENCODER = new
ByteArrayEncoder();

private final NettyConsumer consumer;

private final int maxFrameLength;
private final int lengthFieldOffset;
private final int lengthFieldLength;
private final int lengthAdjustment;
private final int initialBytesToStrip;
private boolean   invoked;
private StringrouteId;

@Override
public ChannelPipeline getPipeline() throws Exception {  
logger.trace(getPipeline(): ENTER);

invoked = true;  
ChannelPipeline channelPipeline = Channels.pipeline();  

String theRouteId = consumer.getRoute().getId();
logger.info(getPipeline(): {}, routeId = {}, consumer.toString(),
theRouteId);

// ---
// Add logger to print incoming and outgoing data.
// This is both an upstream/downstream handler.
// ---
//String loggerName = MCQ_LOGGING_HANDLER_ + theRouteId;
//channelPipeline.addLast(loggerName, LOG_HANDLER);

//

Code snippets missing from online docs

2015-06-29 Thread Nathan Jones
Code snippets in the docs at camel.apache.org are not rendering for me.
For example, all of the example endpoint URLs on
https://camel.apache.org/components.html are empty. When I inspect the
page source I can see the script blocks containing the code snippets so
I guess this is a JavaScript issue. This affects both Firefox and Chrome.

 - Nathan


Camel website is not showing the code blocks

2015-06-29 Thread xlogger
I tried with a few different browsers on my PC (Firefox, Chrome, and IE..)
but found that the code blocks in all the Camel web pages are not displaying
properly... it looks like they are all collapsed... It was Okay last week
when I browse around

E.g.
http://camel.apache.org/content-based-router.html
http://camel.465427.n5.nabble.com/file/n5768644/Apache_Camel_Content_Based_Router_-_Mozilla_Firefox_2015-06-29_13-44-32.png
 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-website-is-not-showing-the-code-blocks-tp5768644.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unable to shutdown endpoint when intercepted with interceptSendToEndpoint

2015-06-29 Thread gterral
Ticket logged under: 

https://issues.apache.org/jira/browse/CAMEL-8914

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-shutdown-endpoint-when-intercepted-with-interceptSendToEndpoint-tp5768574p5768646.html
Sent from the Camel - Users mailing list archive at Nabble.com.