Managing scheduled jobs programmatically in Camel

2015-01-21 Thread Gershaw, Geoffrey A.
Hello All,

I'm using camel 2.14.1 and have the following use case that I can't figure out 
how to solve in a Camel way.


1.We receive XML messages from JMS and convert them to FIX and send them to 
a quickfixj endpoint. No questions there.

2.The XML message may contain a frequency tag. If that tag is present, I 
need to schedule a job to send the same FIX message every x seconds to the 
quickfixj endpoint.

3.If the frequency tag = 0, I need to lookup and delete the scheduled job.

Is there a way to programmatically create the job when the frequency tag is 
present and then delete it when it goes to 0? Right now, we are using 
TimerTasks with a producer template. I'd prefer to stay in Camel.

Thanks in advance,

Geoff

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.commailto:geoffrey.gers...@credit-suisse.com | 
www.credit-suisse.comhttp://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 
=== 


Logging throttled messages?

2015-01-21 Thread Anton Hughes
Hi

We are looking at using the throttler, but would like to know if it is
possible to log throttled messages.

Does anyone know if that is possible?

Thanks


Re: Choosing between Mapping Options

2015-01-21 Thread Reji Mathews
Hi Satyam

XSLT/XQuery  is cleaner, better performing and above all easy to update and
maintain.

Maintaining or making any change in java object based mapping is more time
consuming and calls for code checkout edit , project re compiling / re
bundling and re deployments .

If xsd undergoes updates , then it might call for more efforts to maintain
java mappings.

Cheers
Reji
 On 21 Jan 2015 13:00, Satyam Maloo maloosat...@gmail.com wrote:

 We have a camel project requirement where 5 SOAP based CXF services needs
 to
 interact with each other.
 Among these 2 camel projects are consumer and 3 cxf providers.

 The integration framework used is JBoss Fuse ESB.

 At the Integration layer we have created a common canonical format xsd.
 Now we need to do transformations from consumer data format to the common
 canonical data format and form common data format to provider data format
 and vice versa.

 We have the below options available for data mapping:
 1. Creating POJO classes from wsdl and common xsd using wsdl2java plugin on
 wsdl and then in the routes write java converters/mapping (something like
 targetStructure.set(incomingStructure.get()))
 2. Use xslt/xquery for transformation

 Which is a better option? Java mapping or XLST mapping? Consider that we
 are
 using CXF framwork  to push data to target system and writing integration
 flows using Spring DSL
 Kindly suggest with advantages over the other.
 Thanks in advance.

 Satyam



 -
 Satyam
 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Choosing-between-Mapping-Options-tp5761977.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: how to run a consumer route once?

2015-01-21 Thread aidatechinc
yep that did it. thank you



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-run-a-consumer-route-once-tp5761932p5762003.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXFRS component to expose Rest apis

2015-01-21 Thread cgsk
Thanks for the reply. What is the impact in running multiple rssservers
interms of performance?

Regards.



--
View this message in context: 
http://camel.465427.n5.nabble.com/CXFRS-component-to-expose-Rest-apis-tp5761958p5761989.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Messages sitting on ActiveMq for x period of time

2015-01-21 Thread James Green
May be worth connecting to ActiveMQ to inspect it at the JMX level (hawt.io
is an excellent interface). Check why ActiveMQ thinks it should not be
delivering it.

On 21 January 2015 at 04:29, mvandersteen 
mark.vanderst...@servicestream.com.au wrote:

 Hi Guys,

 I have 1 queue created through camel that holds onto messages for approx 15
 minute before a consumer will pick them up.

 A cxf web service listens for incoming message as SOAP, then pushes
 translated message to  said queue.

 That message will sit there for approx 15 minutes before another route will
 pick it up for processing. We have approx 100 different queues across 25
 bundles or so and this is the only one I've seen this happen on. Which to
 me
 indicates some configuration somewhere.

 I've been developing camel for approx 18 months and not seen this behaviour
 before either hence the question to you guys. I can't see anything obvious
 in configuration files for the bundle or parameters being set for the jms
 queue either.

 Could anyone please give me a few pointers on what might be happening here.

 Cheers
 Mark



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Messages-sitting-on-ActiveMq-for-x-period-of-time-tp5761970.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Rest DSL Exception mapping

2015-01-21 Thread James Green
Just re-reading the Binding POJOs bit, will this also take effect for the
out part of an exception?

onException(MyException.class).handled(true).setHeader(Exchange.HTTP_RESPONSE_CODE,
constant(400)).process(myExceptionHandler).end()

Should I expect the Message provided by myExceptionHandler to be formatted
to JSON/XML according to the HTTP client's choice?


On 21 January 2015 at 11:51, James Green james.mk.gr...@gmail.com wrote:

 If Camel can accept and map both JSON and XML inputs to POJOs, is there a
 way of reversing this for onException handling purposes?

 The only example of onException sets the content-type and formatted
 content on the Exchange. But I may not know this.

 Within Spring MVC there is @ResponseStatus allowing us to specify the HTTP
 response code for a particular Exception without needing to care about the
 response content type, which is the bit I'm not spotting an equivalent for.

 Am I missing something or is this a bit of a hole?

 Thanks,

 James




Re: Rest DSL Exception mapping

2015-01-21 Thread Claus Ibsen
You can use the option skipBindingOnErrorCode to control if the
binding should happen or not.

On Wed, Jan 21, 2015 at 1:24 PM, James Green james.mk.gr...@gmail.com wrote:
 Just re-reading the Binding POJOs bit, will this also take effect for the
 out part of an exception?

 onException(MyException.class).handled(true).setHeader(Exchange.HTTP_RESPONSE_CODE,
 constant(400)).process(myExceptionHandler).end()

 Should I expect the Message provided by myExceptionHandler to be formatted
 to JSON/XML according to the HTTP client's choice?


 On 21 January 2015 at 11:51, James Green james.mk.gr...@gmail.com wrote:

 If Camel can accept and map both JSON and XML inputs to POJOs, is there a
 way of reversing this for onException handling purposes?

 The only example of onException sets the content-type and formatted
 content on the Exchange. But I may not know this.

 Within Spring MVC there is @ResponseStatus allowing us to specify the HTTP
 response code for a particular Exception without needing to care about the
 response content type, which is the bit I'm not spotting an equivalent for.

 Am I missing something or is this a bit of a hole?

 Thanks,

 James





-- 
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: Input directory with multiple file consumers

2015-01-21 Thread Raf
I am no camel expert, but this is my experience.

If you monitor a folder from multiple camel instances (for instance when you 
deploy on multiple servers) then you can only poll for 1 .
If that is not the case you can poll for multiple messages.
By maxMessagesPerPoll=10 to poll for 10 messages
Or maxMessagesPerPoll=0 to poll for all messages.

Regards,
Raf

From: Kondalarv [via Camel] [mailto:ml-node+s465427n576196...@n5.nabble.com]
Sent: woensdag 21 januari 2015 0:34
To: Raf Lenaerts
Subject: RE: Input directory with multiple file consumers

I tried below option and it is working

camel:from 
uri=file:/app/test/data/inbox?readLock=changedamp;delete=trueamp;preMove=processingamp;maxMessagesPerPoll=1/

But I would like to go for multiple messages for poll. do you have any solution 
for this?

If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Input-directory-with-multiple-file-consumers-tp5713788p5761967.html
To unsubscribe from Input directory with multiple file consumers, click 
herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5713788code=cmFmLmxlbmFlcnRzQHBlcnNncm9lcC5iZXw1NzEzNzg4fDExOTY3MzYyNzU=.
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




--
View this message in context: 
http://camel.465427.n5.nabble.com/Input-directory-with-multiple-file-consumers-tp5713788p5761998.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-CXF: Problems transforming namespace of incoming message

2015-01-21 Thread Aki Yoshida
Hi Dirk,
The transform itself should actually take place with the original
interceptor, as the actual output object is replaced with the
stax-transform'ed XMLStreamWriter regardless of its role. So, I am not
sure why your scenario was not working initially. But I am not sure
why the special requester role handling that you mentioned is there.
Maybe Sergey knows it?

I don't quite follow your second point. Your consumer endpoint uses
WSDL-B and it can accept the B's namespace and in addition, as the
transform feature configured, it can accept the A's namespace. The
transform feature makes sure that the messages are forwarded using the
B's namespace so that they matche the service interface. If you need
WSDL-A, you can host this file somewhere else. So, I am not familiar
with your use case. The transform feature is typically used as a
workaround to support those legacy clients that had the WSDL from
elsewhere that don't match the actual service's WSDL.So, the actual
endpoint doesn't have to provide the alternative WSDL.

regards, aki

2015-01-21 8:35 GMT+01:00 Dirk Lattermann - expertplace
dirk.latterm...@expertplace.de:
 Hi,

 thanks for your answer!

 The intention is different:

 Working routing is:

from CXF-B(1) -- (if ..some condition..) -- to CXF-B(2) on different host

 additional, a namespace mapping is needed:

from CXF-A -- namespace mapping A to B -- to CXF-B(1) so that above 
 route is taken

 the namespace mapping A to B must include mapping the response back from 
 namespace B to A.

 What I have working or the mapping is an consuming endpoint servicing the B 
 namespace (not good because it offers the wrong WSDL to the client), 
 configured with StaxTransformationFeature with inTransformElements (namespace 
 A to B).
 For the response, StaxTransformationFeature with outTransformElements doesn't 
 work: digging in the source I found that TransformationOutInterceptor has a 
 condition that prevents transforming responses. Only outgoing requests are 
 mapped (that is, in producer mode). Curiously, the 
 TransformationInInterceptor doesn't have this restriction.

 I solved this by copying the TransformationOutInterceptor into a new class 
 and removing the if condition in line 100. Then, I added this new class as an 
 outInterceptor to the endpoint. Now the mapping works for the requests and 
 the responses!

 The only drawback: my incoming mapping endpoint uses the wrong WSDL file (for 
 namespace B instead of namespace A).
 Is there a Phase in the CXF processing to which the 
 TransformationInInterceptor could be attached so that CXF wouldn't complain 
 about a namespace mismatch when using WSDL for namespace A and transforming 
 the incoming message to namespace B?

 Thank you,
 Dirk


 -Ursprüngliche Nachricht-
 Von: Aki Yoshida [mailto:elak...@gmail.com]
 Gesendet: Dienstag, 20. Januar 2015 11:10
 An: users@camel.apache.org
 Betreff: Re: Camel-CXF: Problems transforming namespace of incoming message

 I don't think the http endpoint can be used to bridge typical soap webservice 
 calls, as there are some mismatches in the behavior between the soap protocol 
 and the plain http protocol.

 If I understand your scenario, you want to do something like from-cxf:A --- 
 to-cxf:A if ...some condition...
 from-cxf:A  to-cxf:B if ...some condition...
 and cxf:A- cxf:B requires a minor namespace replacement, no?

 In that case, you can just use the PAYLOAD mode for all the cxf endpoints and 
 configure the transform feature at the to-cxf:B endpoint to replace the 
 namespace.




 2015-01-19 17:29 GMT+01:00 Dirk Lattermann - expertplace
 dirk.latterm...@expertplace.de:
 Hello,

 we need to build a proxy for an external request/reply SOAP web service. 
 This same service must be offered both unmodified (namespace A) and with a 
 different namespace B in the message schema. In both cases, some additional 
 routing decisions must be taken.

 For this, we have defined a CXF producer endpoint (using cxf:cxfEndpoint) in 
 POJO message format that addresses the external service, using their WSDL 
 (namespace A). The unmodified proxy on the consuming (input) side is also a 
 CXF endpoint in POJO format, using the same WSDL. A route forwards (after 
 some routing decisions) from this to the external service; this works.

 To offer the service with a different namespaces, we tried several 
 approaches without success.

 One possibility seems to be a CXF consumer endpoint in MESSAGE message 
 format that uses a StaxTransformationFeature to modify the namespace from B 
 to A.
 This endpoint uses a modified WSDL with namespace B instead of A. It must 
 use MESSAGE, not POJO, because the WSDL file with the modified message 
 namespace B would not match the transformed message in namespace A, which 
 results in a parsing (JAXB) exception from CXF. We would like to send the 
 transformed message to our own namespace A consumer endpoint to run through 
 the normal routing decisions mentioned