RE: Hazelcast Component question

2020-02-10 Thread Gershaw, Geoffrey A.
Hi Claus,

Thanks for taking your time to answer my question and thanks for Camel. I would 
be happy to contribute documentation if you can help me with an example of the 
config file and how to set the hazelcast instance on the hazelcast component? 
Thanks again!!!

Geoffrey A Gershaw
Credit IT Global Loans Dev - RL
+1 919 994 6412, (*102 6412)


-Original Message-
From: Claus Ibsen  
Sent: Saturday, February 8, 2020 2:26 AM
To: users@camel.apache.org
Subject: Re: Hazelcast Component question

On Fri, Feb 7, 2020 at 10:25 PM Gershaw, Geoffrey A.
 wrote:
>
> Thank you for taking the time to answer my question. This doesn't seem very 
> easy to configure and it's not documented. Would it be possible to put a good 
> example on the components webpage?
>

Yes we love contributions, so you or others are welcome to work on such an 
example and add to the documentation.
https://camel.apache.org/manual/latest/contributing.html



> Thanks
>
> Geoffrey A Gershaw
> Credit IT Global Loans Dev - RL
> +1 919 994 6412, (*102 6412)
>
>
> -Original Message-
> From: Andrea Cosentino 
> Sent: Thursday, February 6, 2020 1:35 PM
> To: users@camel.apache.org
> Subject: Re: Hazelcast Component question
>
> You should be able to set an HazelcastInstance at component level.
>
> So you can define a Config with all of your parameters call an
> Hazelcast.getOrCreateHazelcastInstance(config)
>
> and then set the instance on your component.
>
> Il giorno gio 6 feb 2020 alle ore 19:21 Gershaw, Geoffrey A. < 
> geoffrey.gers...@credit-suisse.com> ha scritto:
>
> > Hi All,
> >
> > The samples on the component's webpage do not include where to put 
> > the IP address/port of the hazelcast node? Could someone share how 
> > to configure it or update the webpage?
> >
> > Thanks
> >
> > Geoffrey A Gershaw
> > CREDIT SUISSE SECURITIES (USA) LLC
> > CS Sec USA LLC | Credit IT Global Loans Dev - RL, VIHE 33
> > 6933 Louis Stephens Drive | Raleigh NC 27560 | Americas Phone +1 919
> > 994 6412
> > geoffrey.gers...@credit-suisse.com > geoffrey.gers...@credit-suisse.com> | www.credit-suisse.com< 
> > http://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
> ==
> =



--
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


RE: Hazelcast Component question

2020-02-07 Thread Gershaw, Geoffrey A.
Thank you for taking the time to answer my question. This doesn't seem very 
easy to configure and it's not documented. Would it be possible to put a good 
example on the components webpage?

Thanks

Geoffrey A Gershaw
Credit IT Global Loans Dev - RL
+1 919 994 6412, (*102 6412)


-Original Message-
From: Andrea Cosentino  
Sent: Thursday, February 6, 2020 1:35 PM
To: users@camel.apache.org
Subject: Re: Hazelcast Component question

You should be able to set an HazelcastInstance at component level.

So you can define a Config with all of your parameters call an
Hazelcast.getOrCreateHazelcastInstance(config)

and then set the instance on your component.

Il giorno gio 6 feb 2020 alle ore 19:21 Gershaw, Geoffrey A. < 
geoffrey.gers...@credit-suisse.com> ha scritto:

> Hi All,
>
> The samples on the component's webpage do not include where to put the 
> IP address/port of the hazelcast node? Could someone share how to 
> configure it or update the webpage?
>
> Thanks
>
> Geoffrey A Gershaw
> CREDIT SUISSE SECURITIES (USA) LLC
> CS Sec USA LLC | Credit IT Global Loans Dev - RL, VIHE 33
> 6933 Louis Stephens Drive | Raleigh NC 27560 | Americas Phone +1 919 
> 994 6412
> geoffrey.gers...@credit-suisse.com geoffrey.gers...@credit-suisse.com> | www.credit-suisse.com< 
> http://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 
=== 


Hazelcast Component question

2020-02-06 Thread Gershaw, Geoffrey A.
Hi All,

The samples on the component's webpage do not include where to put the IP 
address/port of the hazelcast node? Could someone share how to configure it or 
update the webpage?

Thanks

Geoffrey A Gershaw
CREDIT SUISSE SECURITIES (USA) LLC
CS Sec USA LLC | Credit IT Global Loans Dev - RL, VIHE 33
6933 Louis Stephens Drive | Raleigh NC 27560 | Americas
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 
=== 


Hazelcast Component question

2020-02-04 Thread Gershaw, Geoffrey A.
Hi All,

The samples on the component's webpage do not include where to put the IP 
address/port of the hazelcast node? Could someone share how to configure it?

Thanks

Geoffrey A Gershaw
CREDIT SUISSE SECURITIES (USA) LLC
CS Sec USA LLC | Credit IT Global Loans Dev - RL, VIHE 33
6933 Louis Stephens Drive | Raleigh NC 27560 | Americas
Phone +1 919 994 6412
geoffrey.gers...@credit-suisse.com | 
www.credit-suisse.com

===
For important information on costs and charges disclosures please visit:
https://www.credit-suisse.com/uk/en/investment-banking/financial-regulatory/customer-notices/costs-and-charges.html
===
=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


Retrieve all properties in CamelContext

2016-08-16 Thread Gershaw, Geoffrey A.
Hello,


I have seen the question asked, but I don't see a clean solution to get all the 
properties from a CamelContext so that I may print them out.  I'm using the 
BridgePropertyPlaceholderConfigurer. I am at Camel 2.16.x. Any advice is 
appreciated



Thanks much,



Geoff

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


Automatic Type Conversion of FIX Messages working as expected?

2016-03-24 Thread Gershaw, Geoffrey A.
Hello All,

I am using camel 2.16.x. I wrote a quickfixj server, an acceptor in quickfixj 
terms. I receive a message from quickfij, use a filter to determine the message 
is a BusinessMessageReject and call the below method

public void handleReject(final BusinessMessageReject rejectMsg)

I get an error saying it can't convert a quickfixj.Message to 
quickfix.fix50sp2.BusinessMessageReject. I tried this as well, but the cast 
fails

public void handleReject(final quickfixj.Message rejectMsg)
(BusinessMessageReject) rejectMsg

I feel like I used this before with no issues.

Thanks for you continued support.

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


Checking the body type of an exchange using simple

2016-02-25 Thread Gershaw, Geoffrey A.
Hello,

I am trying to use header.type in simple to determine the type of the body. I 
have tried many variations of header ie (in.header, headers) etc, but it always 
seems like type and BodyType are empty or null.

I have tried with Camel 2.16.1 and 2.16.2. I assume I'm missing something basic.



Thanks,


Geoffrey A Gershaw

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


Managing scheduled jobs programmatically in Camel

2015-01-22 Thread Gershaw, Geoffrey A.
Hello,

A quick update to this. Would the camel approach to managing Quartz jobs 
programmatically be:


1.For every new job, create a new route dynamically. The quartz endpoint 
would be configured dynamically by creating the option string programmatically. 
Something like this:

a.
from(quartz2://myGroup/myTimerName?trigger.repeatInterval=2trigger.repeatCount=1).routeId(myRoute).to(mock:result)



2.To delete the job, stop/delete the route.



3. To change the job,  do step 2 followed by step 1.



4.If the above is correct, I would like to send the new quartz route an 
object that it will send according to the schedule. Once the quartz route has 
this object, it can start firing. I don't want it firing without the object.


Hopefully, the above is clear. Any suggestions, would be greatly appreciated.


Thanks,


Geoffrey A Gershaw




=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 


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 
=== 


XPATH woes

2014-11-13 Thread Gershaw, Geoffrey A.
Hi All,

I'm trying to filter via xpath using the spring config. I'm running camel 
2.12.3.


An example msg

Envelope xmlns=http://removed  xmlns:bem=http:/removed  
xmlns:price=http://removed; messageId=xx schemaVersion=1.0 instanceId=xx 
publishMessageDtm=2014-11-13T22:27:07+00:00 
publishMessageDtInMs=2014-11-13T22:27:07.835+00:00 publishingSystemCd=xx


This below filter always evaluates to false. Any ideas?

filter
   xpath/Envelope/@schemaVersion='1.0'/xpath
   camel:log message=${body}/
 /filter

Thanks


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 
=== 


JMS Component -Tibco specific option

2013-10-24 Thread Gershaw, Geoffrey A. (KFFC 223)
Hi Camel Riders,

Has anyone ever had to set Tibco or other implementation specific options for 
JMS on the publisher? I don't see any examples of how to do that on the web 
page. Specifically, I would like to do 
publisher.setDeliveryMode(com.tibco.tibjms.Tibjms.RELIABLE_DELIVERY)

We use camel 2.11 and spring DSL. I guess I need to use a custom publisher 
instead of relying on default publisher in

to uri=jms:topic:{{pricecollision.topic}}?deliveryPersistent=false /

Thanks for your help

Geoff


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: JMS Component -Tibco specific option

2013-10-24 Thread Gershaw, Geoffrey A. (KFFC 223)
Hi Paula,

Thanks for the attempt. com.tibco.tibjms.TibjmsConnectionFactory does not have 
a property for delivery mode. Unless I'm missing, which is possible. :)

Thanks
Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)

-Original Message-
From: Paul Gale [mailto:paul.n.g...@gmail.com] 
Sent: Thursday, October 24, 2013 1:33 PM
To: users@camel.apache.org
Subject: Re: JMS Component -Tibco specific option

Hi Geoff,

You could try something like this which is working for us:

beans
  !-- omitting the usual ActiveMQ connection factory config --

  bean id=tibco class=org.apache.camel.component.jms.JmsComponent
property name=connectionFactory
  bean class=com.tibco.tibjms.TibjmsConnectionFactory
property name=serverUrl value=${tibco.server.url}/
property name=userName value=${tibco.username}/
property name=userPassword value=${tibco.password}/
!-- insert Tibco specific properties here --
  /bean
/property
  /bean

camelContext
  route
from uri=activemq:topic:foo/
to uri=tibco:topic:bar/
  /route
/camelContext
/beans

Put the following entry (or similar) in your pom.xml file:

dependency
  groupIdcom.tibco.ems/groupId
  artifactIdtibjms/artifactId
  version5.0.0/version
  scoperuntime/scope
/dependency

and the following jar on our classpath:  tibjms-5.0.0.jar

HTH

Thanks,
Paul

On Thu, Oct 24, 2013 at 1:11 PM, Gershaw, Geoffrey A. (KFFC 223)
geoffrey.gers...@credit-suisse.com wrote:
 Hi Camel Riders,

 Has anyone ever had to set Tibco or other implementation specific options for 
 JMS on the publisher? I don't see any examples of how to do that on the web 
 page. Specifically, I would like to do 
 publisher.setDeliveryMode(com.tibco.tibjms.Tibjms.RELIABLE_DELIVERY)

 We use camel 2.11 and spring DSL. I guess I need to use a custom publisher 
 instead of relying on default publisher in

 to uri=jms:topic:{{pricecollision.topic}}?deliveryPersistent=false /

 Thanks for your help

 Geoff


 ===
 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: JMS Component -Tibco specific option

2013-10-24 Thread Gershaw, Geoffrey A. (KFFC 223)
I love you people

-Original Message-
From: Christian Posta [mailto:christian.po...@gmail.com] 
Sent: Thursday, October 24, 2013 2:16 PM
To: users@camel.apache.org
Subject: Re: JMS Component -Tibco specific option

Take a look at this JIRA: https://issues.apache.org/jira/browse/CAMEL-4257

We've fixed this for deliveryMode in upcoming 2.12.2 / 2.13


On Thu, Oct 24, 2013 at 10:11 AM, Gershaw, Geoffrey A. (KFFC 223) 
geoffrey.gers...@credit-suisse.com wrote:

 Hi Camel Riders,

 Has anyone ever had to set Tibco or other implementation specific options
 for JMS on the publisher? I don't see any examples of how to do that on the
 web page. Specifically, I would like to do
 publisher.setDeliveryMode(com.tibco.tibjms.Tibjms.RELIABLE_DELIVERY)

 We use camel 2.11 and spring DSL. I guess I need to use a custom publisher
 instead of relying on default publisher in

 to uri=jms:topic:{{pricecollision.topic}}?deliveryPersistent=false /

 Thanks for your help

 Geoff



 ===
 Please access the attached hyperlink for an important electronic
 communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html

 ===




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


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Crashing on Startup

2013-10-23 Thread Gershaw, Geoffrey A. (KFFC 223)
Hello All,

I am running Camel 2.11.0 and it appears it crashed this AM. This is all we 
have in the log. The dump must be moved somewhere to conserve disk. Any 
thoughts?

Thanks


02:00:12,387 [main] INFO  com.csfb.fid.credit.cds.MainSpring  - Starting Camel. 
Use ctrl + c to terminate the JVM.

02:00:12,392 [main] INFO  org.apache.camel.main.MainSupport  - Apache Camel 
2.11.0 starting
02:00:14,191 [main] INFO  org.apache.camel.spring.SpringCamelContext  - Apache 
Camel 2.11.0 (CamelContext: camel-1) is start
ing
02:00:14,237 [main] INFO  org.apache.camel.management.ManagementStrategyFactory 
 - JMX enabled.
02:00:14,372 [main] INFO  org.apache.camel.impl.converter.DefaultTypeConverter  
- Loaded 176 type converters




=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Simple Language Question

2013-09-16 Thread Gershaw, Geoffrey A. (KFFC 223)
Thanks Claus,

So using simple, the below is accurate? camelContext is a keyword in simple 
then?
${camelContext.getEndpoint('seda:foo').currentQueueSize}


Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Saturday, September 14, 2013 6:42 AM
To: users@camel.apache.org
Subject: Re: Simple Language Question

Hi

You need to use getCurrentQueueSize to get the current size. The size
is for the max size of the queue.

I added unit test to demonstrate how to do that
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=camel-core/src/test/java/org/apache/camel/component/seda/SedaSimpleSizeTest.java;hb=0c1b2c53

On Fri, Sep 13, 2013 at 7:11 PM, Gershaw, Geoffrey A. (KFFC 223)
geoffrey.gers...@credit-suisse.com wrote:
 Sorry, I should have said this 2.11

 Geoffrey A Gershaw
 Credit eTrading Development
 +1 919 994 6412 (*102 6412)


 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Friday, September 13, 2013 8:49 AM
 To: users@camel.apache.org
 Subject: Re: Simple Language Question

 What Camel version do you use?

 On Thu, Sep 12, 2013 at 6:03 PM, Gershaw, Geoffrey A. (KFFC 223)
 geoffrey.gers...@credit-suisse.com wrote:
 Hello,


 I am trying to print the size of a seda queue in a log statement. See my 
 attempt below. I need to get hold of the Context so I can lookup the seda 
 endpoint. I thought I could do this via the Exchange. I can seem to get a 
 hold of that either.

 Anyone know how to get a reference to the CamelContext or Exchange in simple?

 camel:log message=HandleMultiMarketDataIncremental in 
 ${date:now:HH:mm:ss.SSS} 
 sedaQueue:${in.getExchange().getContext().getEndpoint('seda:HandleMultiMarketDataIncremental').size()}/

 Thanks much

 Geoffrey A Gershaw



 ===
 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
 ===




-- 
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: ProducerTemplate without using Spring

2013-09-16 Thread Gershaw, Geoffrey A. (KFFC 223)
Hi, 

Not a camel solution, but couldn't you load it once on startup of your app and 
keep it in an instance controlled class or singleton?

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Achim Nierbeck [mailto:bcanh...@googlemail.com] 
Sent: Monday, September 16, 2013 7:25 AM
To: users@camel.apache.org
Subject: Re: ProducerTemplate without using Spring

Hi again,

still looking for a way on how to solve this,
what is the best way of registering a Single ProducerTemplate without using
Spring?
Cause right now I still use the way of creating a producer Template every
time I need to communicate with
a Camel Route which sooner or later results in a issue which I did describe
at [1].

Thanks and regards, Achim

[1] - https://issues.apache.org/jira/browse/CAMEL-6695


2013/9/11 Achim Nierbeck bcanh...@googlemail.com

 Hi there,

 I have a interesting setup right now using the ProducerTemplate.

 I found the following:

 http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html
 on how to add a global usable ProducerTemplate as your not supposed to
 recreate the Producer template within every Process that needs to
 communicate with a camel route.
 Now I'm not able to use spring and therefore I'm looking for a way to
 register a reusable ProducerTemplate so I'm able to access it via the
 following in my CustomBeans.
 ProducerTemplate template = context.getRegistry().lookup(template,
 ProducerTemplate.class);
 where context is the camel-Context.
 Injection doesn't work for me as I'm calling this within EJBs, and worse I
 needed to lookup the camel-context via jndi beforehand.

 regards, Achim
 --

 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/




-- 

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/


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Simple Language Question

2013-09-13 Thread Gershaw, Geoffrey A. (KFFC 223)
Sorry, I should have said this 2.11

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Friday, September 13, 2013 8:49 AM
To: users@camel.apache.org
Subject: Re: Simple Language Question

What Camel version do you use?

On Thu, Sep 12, 2013 at 6:03 PM, Gershaw, Geoffrey A. (KFFC 223)
geoffrey.gers...@credit-suisse.com wrote:
 Hello,


 I am trying to print the size of a seda queue in a log statement. See my 
 attempt below. I need to get hold of the Context so I can lookup the seda 
 endpoint. I thought I could do this via the Exchange. I can seem to get a 
 hold of that either.

 Anyone know how to get a reference to the CamelContext or Exchange in simple?

 camel:log message=HandleMultiMarketDataIncremental in 
 ${date:now:HH:mm:ss.SSS} 
 sedaQueue:${in.getExchange().getContext().getEndpoint('seda:HandleMultiMarketDataIncremental').size()}/

 Thanks much

 Geoffrey A Gershaw



 ===
 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 
=== 



Simple Language Question

2013-09-12 Thread Gershaw, Geoffrey A. (KFFC 223)
Hello,


I am trying to print the size of a seda queue in a log statement. See my 
attempt below. I need to get hold of the Context so I can lookup the seda 
endpoint. I thought I could do this via the Exchange. I can seem to get a hold 
of that either.

Anyone know how to get a reference to the CamelContext or Exchange in simple?

camel:log message=HandleMultiMarketDataIncremental in 
${date:now:HH:mm:ss.SSS} 
sedaQueue:${in.getExchange().getContext().getEndpoint('seda:HandleMultiMarketDataIncremental').size()}/

Thanks much

Geoffrey A Gershaw



=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Enums in spring config not working

2013-08-01 Thread Gershaw, Geoffrey
Hi,

Just wondered if someone could verify that enums work in spring using simple. 
Please see below

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Gershaw, Geoffrey 
Sent: Wednesday, July 31, 2013 8:36 AM
To: users@camel.apache.org
Subject: RE: Enums in spring config

Hi Christian,

Thanks for your reply. Does it work in the spring xml?  It appears like static 
attributes work, but not enums.

See log output and example.

simple${header.EventCategory} == 
${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageReceived}/simple

[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find class: 
org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageReceived
[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find class: 
org.apache.camel.component.quickfix.QuickfixjEventCategory


Yes, I have the module in my classpath 

 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-quickfix/artifactId
 /dependency




Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Tuesday, July 30, 2013 6:51 PM
To: users@camel.apache.org
Subject: Re: Enums in spring config

It works with 2.11.0 [1]. What's the exception do you get?

[1]
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=camel-core/src/test/java/org/apache/camel/processor/CBRSimpleTypeTest.java;h=aaf9051b9e97a1971e923f8319b688c8bd80b686;hb=99b5784e1fc5fd529c0178f9a8f60ac37fed5682

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Jul 30, 2013 at 10:20 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello All,



 I was under the impression that enums can now be specified in the Spring
 config as in the below example. Having issues. Any advice?



 simple${header.EventCategory} ==
 ${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMes
 sageReceived}/simple



 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class:
 org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageRec
 eived

 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class: org.apache.camel.component.quickfix.QuickfixjEventCategory





 Yes, I have the module in my classpath J



  dependency

groupIdorg.apache.camel/groupId

artifactIdcamel-quickfix/artifactId

  /dependency





 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
 http://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: Enums in spring config

2013-07-31 Thread Gershaw, Geoffrey
Hi Christian,

Thanks for your reply. Does it work in the spring xml?  It appears like static 
attributes work, but not enums.

See log output and example.

simple${header.EventCategory} == 
${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageReceived}/simple

[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find class: 
org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageReceived
[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find class: 
org.apache.camel.component.quickfix.QuickfixjEventCategory


Yes, I have the module in my classpath 

 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-quickfix/artifactId
 /dependency




Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Tuesday, July 30, 2013 6:51 PM
To: users@camel.apache.org
Subject: Re: Enums in spring config

It works with 2.11.0 [1]. What's the exception do you get?

[1]
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=camel-core/src/test/java/org/apache/camel/processor/CBRSimpleTypeTest.java;h=aaf9051b9e97a1971e923f8319b688c8bd80b686;hb=99b5784e1fc5fd529c0178f9a8f60ac37fed5682

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Jul 30, 2013 at 10:20 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello All,



 I was under the impression that enums can now be specified in the Spring
 config as in the below example. Having issues. Any advice?



 simple${header.EventCategory} ==
 ${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMes
 sageReceived}/simple



 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class:
 org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageRec
 eived

 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class: org.apache.camel.component.quickfix.QuickfixjEventCategory





 Yes, I have the module in my classpath J



  dependency

groupIdorg.apache.camel/groupId

artifactIdcamel-quickfix/artifactId

  /dependency





 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
 http://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 
=== 



Enums in spring config

2013-07-30 Thread Gershaw, Geoffrey
Hello All,

 

I was under the impression that enums can now be specified in the Spring
config as in the below example. Having issues. Any advice?

 

simple${header.EventCategory} ==
${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMes
sageReceived}/simple

 

[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
class:
org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageRec
eived

[pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
class: org.apache.camel.component.quickfix.QuickfixjEventCategory

 

 

Yes, I have the module in my classpath J

 

 dependency

   groupIdorg.apache.camel/groupId

   artifactIdcamel-quickfix/artifactId

 /dependency

 

 

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
http://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 
=== 



RE: Enums in spring config

2013-07-30 Thread Gershaw, Geoffrey
Sorry,

I am on 2.11.  Sorry for not adding thi

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Raul Kripalani [mailto:r...@evosent.com] 
Sent: Tuesday, July 30, 2013 4:31 PM
To: users@camel.apache.org
Subject: Re: Enums in spring config

What Camel version are you on? This feature is available from Camel 2.11
onwards, according to the doc page.

Regards,

*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 Tue, Jul 30, 2013 at 9:20 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello All,



 I was under the impression that enums can now be specified in the Spring
 config as in the below example. Having issues. Any advice?



 simple${header.EventCategory} ==
 ${type:org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMes
 sageReceived}/simple



 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class:
 org.apache.camel.component.quickfix.QuickfixjEventCategory.AppMessageRec
 eived

 [pool-1-thread-1] WARN org.apache.camel.util.ObjectHelper - Cannot find
 class: org.apache.camel.component.quickfix.QuickfixjEventCategory





 Yes, I have the module in my classpath J



  dependency

groupIdorg.apache.camel/groupId

artifactIdcamel-quickfix/artifactId

  /dependency





 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
 http://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 
=== 



Spring Config. Referencing a bean created in a route

2013-07-26 Thread Gershaw, Geoffrey
Hello All,

 

I am trying to use the pollingConsumer. You need to inject the
consumerTemplate into your bean. I figured that since consumerTemplate
is defined within the camel context, I need to define my bean within the
context.

 

When I do this, I can't reference this bean using bean ref... . Any
ideas? 

 

Thanks

 

 

   camel:camelContext xmlns=http://camel.apache.org/schema/spring;


  

  camel:consumerTemplate id=consumerTemplate /

  

  camel:route id=autoexec-messageHandler

 camel:from uri=timer://start?repeatCount=1/

 

 camel:bean
beanType=com.cs.algo.autoexecution.camelinterface.ConsumerTemplateBean


   method=setConsumer(${ref:consumerTemplate})
id=thisConsumer /

 

 camel:bean ref=thisConsumer

 

  /camel:route

 

  

   /camel:camelContext

 

 

 

 

 

09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
Starting AutoExecution...

09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
Spring context initialized.

09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
Starting Camel...

[main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
starting

09:32:14 [main] INFO
com.cs.algo.autoexecution.camelinterface.MessageFactory - Setting up
login request algoautoexec

[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is starting

[main] INFO org.apache.camel.management.ManagementStrategyFactory - JMX
enabled.

[main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
Loaded 177 type converters

[main] WARN org.apache.camel.util.ObjectHelper - Cannot find class:
thisConsumer

[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is shutting down

[main] INFO org.apache.camel.spring.SpringCamelContext - Uptime 0.902
seconds

[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is shutdown in 0.002 seconds

[main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
stopping

09:32:16 [main] ERROR com.cs.algo.autoexecution.AutoExecutionMain -
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
autoexec-messageHandler at:  Bean[ref:thisConsumer]  in route:
Route(autoexec-messageHandler)[[From[timer://start?repeatCou... because
of No bean could be found in the registry for: thisConsumer

 

 

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
http://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 
=== 



RE: Spring Config. Referencing a bean created in a route

2013-07-26 Thread Gershaw, Geoffrey
So you can refer to consumerTemplate from outside the camel context?

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Friday, July 26, 2013 11:51 AM
To: users@camel.apache.org
Subject: Re: Spring Config. Referencing a bean created in a route

I prefer this one:

bean id=myBean class=xxx.MyBean
  property name=consumerTemplate ref=consumerTemplate/
/bean

camel:camelContext xmlns=http://camel.apache.org/schema/spring;
  camel:consumerTemplate id=consumerTemplate /

  camel:route id=autoexec-messageHandler
camel:from uri=timer://start?repeatCount=1/
camel:to uri=bean://myBean
  /camel:route
/camel:camelContext

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Fri, Jul 26, 2013 at 3:38 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello All,



 I am trying to use the pollingConsumer. You need to inject the
 consumerTemplate into your bean. I figured that since consumerTemplate
 is defined within the camel context, I need to define my bean within the
 context.



 When I do this, I can't reference this bean using bean ref... . Any
 ideas?



 Thanks





camel:camelContext xmlns=http://camel.apache.org/schema/spring;
 



   camel:consumerTemplate id=consumerTemplate /



   camel:route id=autoexec-messageHandler

  camel:from uri=timer://start?repeatCount=1/



  camel:bean
 beanType=com.cs.algo.autoexecution.camelinterface.ConsumerTemplateBean


method=setConsumer(${ref:consumerTemplate})
 id=thisConsumer /



  camel:bean ref=thisConsumer



   /camel:route





/camel:camelContext











 09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
 Starting AutoExecution...

 09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
 Spring context initialized.

 09:32:10 [main] INFO  com.cs.algo.autoexecution.AutoExecutionMain -
 Starting Camel...

 [main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
 starting

 09:32:14 [main] INFO
 com.cs.algo.autoexecution.camelinterface.MessageFactory - Setting up
 login request algoautoexec

 [main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
 2.11.0 (CamelContext: camel-1) is starting

 [main] INFO org.apache.camel.management.ManagementStrategyFactory - JMX
 enabled.

 [main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
 Loaded 177 type converters

 [main] WARN org.apache.camel.util.ObjectHelper - Cannot find class:
 thisConsumer

 [main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
 2.11.0 (CamelContext: camel-1) is shutting down

 [main] INFO org.apache.camel.spring.SpringCamelContext - Uptime 0.902
 seconds

 [main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
 2.11.0 (CamelContext: camel-1) is shutdown in 0.002 seconds

 [main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
 stopping

 09:32:16 [main] ERROR com.cs.algo.autoexecution.AutoExecutionMain -
 org.apache.camel.RuntimeCamelException:
 org.apache.camel.FailedToCreateRouteException: Failed to create route
 autoexec-messageHandler at:  Bean[ref:thisConsumer]  in route:
 Route(autoexec-messageHandler)[[From[timer://start?repeatCou... because
 of No bean could be found in the registry for: thisConsumer





 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
 http://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 
=== 



Socket Programming and Camel

2013-07-26 Thread Gershaw, Geoffrey
Hi All,

 

I'm giving up on being able to send a message to a socket and receive
several messages in response from Mina. Looking at Netty, and it looks
to be the same issue. 

 

Goal: 

 

1. Send a msg over a socket to a server.

2. On the same port, receive n msgs in response to the request.

 

From what I have seen, it appears you can only get a single response
from a request. Am I right? If true, this limits the mina/netty to
request reply use cases.

 

Thanks again!!

 

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
http://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 
=== 



RE: Mina Component Question

2013-07-25 Thread Gershaw, Geoffrey
Hi Willem,

Thanks for the reply. I need to listen on the same socket.

Thanks

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Willem jiang [mailto:willem.ji...@gmail.com] 
Sent: Wednesday, July 24, 2013 10:50 PM
To: users@camel.apache.org
Subject: Re: Mina Component Question

Hi,

Do you need to listen to the same socket that you use to send the request?
Or do you just start a new port to listen to call back message?


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, July 25, 2013 at 10:09 AM, Gershaw, Geoffrey wrote:

 Hello All,
  
  
 I am using the mina component as a client to connect to server. The
 interaction between the client and server is sometimes request reply,
 but it can also be request and listen.  
  
  
 I understand how to implement the request and reply scenario.
  
  
 How do I listen to the mina endpoint continuously? In other words, I
 send a request for a stock's price, and I listen to the socket and
 prices come all day. It seems like I need more than just the mina
 component.
  
  
 I was looking into the polling consumer. Am I on the right track?
  
  
 Thanks
  
  
 Geoffrey A Gershaw
  
  
  
  
 ===
   
 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: Mina Component Question

2013-07-25 Thread Gershaw, Geoffrey
Hi Christian,

Thanks for your reply. This link has a sample TCP client using  mina

http://mina.apache.org/mina-project/userguide/ch2-basics/sample-tcp-client.html

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Thursday, July 25, 2013 1:37 PM
To: users@camel.apache.org
Subject: RE: Mina Component Question

How does Mina support this use case?

Best,
Christian
Am 25.07.2013 14:45 schrieb Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com:

 Hi Willem,

 Thanks for the reply. I need to listen on the same socket.

 Thanks

 Geoffrey A Gershaw
 Credit eTrading Development
 +1 919 994 6412 (*102 6412)


 -Original Message-
 From: Willem jiang [mailto:willem.ji...@gmail.com]
 Sent: Wednesday, July 24, 2013 10:50 PM
 To: users@camel.apache.org
 Subject: Re: Mina Component Question

 Hi,

 Do you need to listen to the same socket that you use to send the request?
 Or do you just start a new port to listen to call back message?


 --
 Willem Jiang

 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Web: http://www.fusesource.com | http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
 (English)
   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem





 On Thursday, July 25, 2013 at 10:09 AM, Gershaw, Geoffrey wrote:

  Hello All,
 
 
  I am using the mina component as a client to connect to server. The
  interaction between the client and server is sometimes request reply,
  but it can also be request and listen.
 
 
  I understand how to implement the request and reply scenario.
 
 
  How do I listen to the mina endpoint continuously? In other words, I
  send a request for a stock's price, and I listen to the socket and
  prices come all day. It seems like I need more than just the mina
  component.
 
 
  I was looking into the polling consumer. Am I on the right track?
 
 
  Thanks
 
 
  Geoffrey A Gershaw
 
 
 
 
 
 ===
  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

 ===




=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Mina Component Question

2013-07-25 Thread Gershaw, Geoffrey

  Hello All,
 
 
 Sorry for the re-post.  I am using the mina component as a client to connect 
 to server. The
  interaction between the client and server is sometimes request reply,
  but it can also be request and listen.
 
 
  I understand how to implement the request and reply scenario.
 
 
  How do I listen to the mina endpoint continuously? In other words, I
  send a request for a stock's price, and I listen to the same socket and
  prices come all day. It seems like I need more than just the mina
  component.
 
 
  I was looking into the polling consumer. Am I on the right track?
 
 
  Thanks
 
 
  Geoffrey A Gershaw


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Mina Component Question

2013-07-24 Thread Gershaw, Geoffrey
Hello All,

 

I am using the mina component as a client to connect to server. The
interaction between the client and server is sometimes request reply,
but it can also be request and listen. 

 

I understand how to implement the request and reply scenario.

 

How do I listen to the mina endpoint continuously? In other words, I
send a request for a stock's price, and I listen to the socket and
prices come all day. It seems like I need more than just the mina
component.

 

I was looking into the polling consumer. Am I on the right track?

 

Thanks

 

Geoffrey A Gershaw

 



=== 
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-19 Thread Gershaw, Geoffrey
Thanks for this. Its exactly what I needed. Many of the examples begin with   
camel:from uri=direct:start/. Therefore, I assumed that this tag worked 
like the Main class of a project. Kicking things off. It appears start is just 
another name that can be used with direct and you would need to publish to this 
route to get its pipeline to execute.
 

Thanks again for clarification. I was wondering why direct:start's special 
capabilities were not on the direct component's web page. Now I get it, it 
doesn't have them.

Wish this was mentioned on the direct components webpage.

Anyhow,

Thanks
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 6:07 PM
To: users@camel.apache.org
Subject: Re: Hello World? Maybe not :)

Direct is used to link routes, such that one Camel route can call another
directly without resorting to any external protocols.

You want to use the Timer component instead, as you rightly noticed already.

HTH,
Raúl.

On Thu, Jul 18, 2013 at 11:37 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 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



  camel:route id=loginRoute 
 
  camel:from uri=direct:start/
 
  camel:log message=Hello World
  loggingLevel=INFO/
 
  /camel:route
 
 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
 
 
 
  ?xml version=1.0 encoding=UTF-8?
 
  beans default-init-method=init
 
  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
 
  
 
 
 
  camelContext xmlns=http://camel.apache.org/schema/spring;
  
 
  dataFormats
 
  jaxb id=myJaxb prettyPrint=true
  contextPath=com.prasad.sample/
 
  /dataFormats
 
 
 
  camel:route id=loginRoute 
 
  camel:from uri=direct:start/
 
  camel:log message=Hello World
  loggingLevel=INFO/
 
  /camel:route
 
  /camelContext
 
 
 
  /beans
 
 
 
 
 
 
 
  Geoffrey A Gershaw
 
  CREDIT SUISSE
 
  Information Technology | Credit eTrading Development, KFVB 525
 
  7033 Louis Stephens

Hello World? Maybe not :)

2013-07-18 Thread Gershaw, Geoffrey
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

 

?xml version=1.0 encoding=UTF-8?

beans default-init-method=init

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



 

camelContext xmlns=http://camel.apache.org/schema/spring;


dataFormats

jaxb id=myJaxb prettyPrint=true
contextPath=com.prasad.sample/

/dataFormats 



camel:route id=loginRoute 

camel:from uri=direct:start/

camel:log message=Hello World
loggingLevel=INFO/ 

/camel:route   

/camelContext



/beans

 

 

 

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
http://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 
=== 



RE: Hello World? Maybe not :)

2013-07-18 Thread Gershaw, Geoffrey
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?

camel:route id=loginRoute 

 camel:from uri=direct:start/

camel:log message=Hello World
loggingLevel=INFO/

 /camel:route

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
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



 ?xml version=1.0 encoding=UTF-8?

 beans default-init-method=init

 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

 



 camelContext
xmlns=http://camel.apache.org/schema/spring;


 dataFormats

 jaxb id=myJaxb prettyPrint=true
 contextPath=com.prasad.sample/

 /dataFormats



 camel:route id=loginRoute 

 camel:from uri=direct:start/

 camel:log message=Hello World
 loggingLevel=INFO/

 /camel:route

 /camelContext



 /beans







 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
 http://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 Gershaw, Geoffrey
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



 camel:route id=loginRoute 

 camel:from uri=direct:start/

 camel:log message=Hello World
 loggingLevel=INFO/

 /camel:route

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



 ?xml version=1.0 encoding=UTF-8?

 beans default-init-method=init

 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

 



 camelContext xmlns=http://camel.apache.org/schema/spring;
 

 dataFormats

 jaxb id=myJaxb prettyPrint=true
 contextPath=com.prasad.sample/

 /dataFormats



 camel:route id=loginRoute 

 camel:from uri=direct:start/

 camel:log message=Hello World
 loggingLevel=INFO/

 /camel:route

 /camelContext



 /beans







 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
 http://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 
=== 



Google Protobuf DataFormat

2013-06-11 Thread Gershaw, Geoffrey
Hello all,

 

I receive a JMS BytesMessage that contains the byte array of a Protobuf.
I am then using the unmarshal tag to deserialize the protobuf. The route
is below. I get an InvalidPayloadException. Seen below

 

 

1 caught: org.apache.camel.InvalidPayloadException: No body available of
type:
com.cs.corex.entities.md.ProtoBufMarketDataProto.ProtoBufMarketData but
has value: [B@32a3270f of type: byte[] on: JmsMessage[JmsMessageID:
ID:COLT_UAT_1.2A051A5D55CB557B6A:482]. Exchange[JmsMessage[JmsMessageID:
ID:COLT_UAT_1.2A051A5D55CB557B6A:482]]

 

 

 

  route

 from uri=jms:topic:{{corex.ems.topic}}? /

   to uri=log:Received Corex
Data?level=DEBUG/

   unmarshal

   protobuf
instanceClass=com.cs.corex.entities.md.ProtoBufMarketDataProto$ProtoBuf
MarketData /

 /unmarshal

   to uri=log:Received/Unmarshalled Corex
Data?level=INFO/

  /route

 

The protobuf I am reading was created in C#. So we couldn't use the
ObjectMessage. Any ideas?

 

Thanks

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
http://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 
=== 



Simple languange FQN Enum 2.10.3

2013-02-19 Thread Gershaw, Geoffrey
Hi all,

 

I am trying to use an enum in a simple expression in the Spring DSL . I
see that it will be possible to do this in 2.11. Is there a workaround
till then? Right now I'm using a String literal.

 

From the doc

type:name.field 

Object 

Camel 2.11: To refer to a type or field by its FQN name. To refer to a
field you can append .FIELD_NAME. For example you can refer to the
constant field from Exchange as: org.apache.camel.Exchange.FILE_NAME

 

 

My attempt, which will fail because I'm not using 2.11. Is there another
scripting language that will allow the use of the enum literal?

bean ref=CDSDao
method=getOTRCdxProducts(${type:com.csfb.oddlots.model.SecTypeEnum.INDE
X_CDS})/

 

Thanks


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Route Dependency in XML DSL + JPA

2013-01-18 Thread Gershaw, Geoffrey
Hello,

Thanks for your reply. This strategy appears not to work. Using the jpa
component in the to endpoint tries to store the entity in the message
body into the db. This results in a null pointer. I am trying to
retrieve entities from the db using jpa.

So once route A completes, route B should use the jpa component to get
the entities from the db.

Any other ideas would be appreciated. I might have to write a custom
bean, but I thought Camel could handle this. Seems like a use case.


route id =A
from uri=quickfix:config /
 !-- On login, create MD Request --
filter
simple${header.EventCategory}
=='SessionLogon'/simple
   /filter
to uri=direct-vm:route-b/
/route


route id=B
from uri=direct-vm:route-b/
to
uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
pp.sql.included.cds}} /
bean ref=SecDefinitionFactory method=create/
bean ref=MarketDataRequestFactory method=create/
to uri=quickfix:config?. /
/route   
Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)

-Original Message-
From: Maruan Sahyoun [mailto:sahy...@fileaffairs.de] 
Sent: Monday, January 14, 2013 3:08 PM
To: users@camel.apache.org
Subject: Re: Route Dependency in XML DSL

sorry - I missed the XML prerequisite. 

would it be an option to connect route A to B using a direct endpoint
e.g.:


route id =A
from uri=quickfix:config /
 !-- On login, create MD Request --
filter
simple${header.EventCategory}
=='SessionLogon'/simple
   /filter
to uri=direct-vm:route-b/
/route


route id=B
from uri=direct-vm:route-b/
to
uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
pp.sql.included.cds}} /
bean ref=SecDefinitionFactory method=create/
bean ref=MarketDataRequestFactory method=create/
to uri=quickfix:config?. /
/route   


Maruan Sahyoun

Am 14.01.2013 um 19:55 schrieb Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com:

 Thanks for responding. Unfortunately, this doesn't show any XML DSL
 example. Is it possible in XML?
 
 
 -Original Message-
 From: Maruan Sahyoun [mailto:sahy...@fileaffairs.de] 
 Sent: Monday, January 14, 2013 1:49 PM
 To: users@camel.apache.org
 Subject: Re: Route Dependency in XML DSL
 
 Hi,
 
 there is a sample how to stop a route from another one - can also be
 used for starting.
 
 https://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
 
 Maruan Sahyoun
 
 Am 14.01.2013 um 18:59 schrieb Gershaw, Geoffrey
 geoffrey.gers...@credit-suisse.com:
 
 Actually,
 
 I should clarify, I don't want route B to start before route A is
 finished. If Route B starts before Route A exits,  Route B will send
 msgs to quickfix before quickfix is finished logging in.  Since Route
 B
 has a JPA component as the from endpoint, as soon as its started, it
 will start creating exchanges.
 
 Therefore, I don't think it should start till A finishes. Unless you
 could use some type of locking Mechanism.
 
 -Original Message-
 From: Gershaw, Geoffrey 
 Sent: Monday, January 14, 2013 12:40 PM
 To: users@camel.apache.org
 Subject: RE: Route Dependency in XML DSL
 
 Yes, route a to call route b. I don't think it can be using the
direct
 component. I need the from of route b to use the jpa component.
 
 route id =A
   from uri=quickfix:config /
   !-- On login, create MD Request --
   filter
   simple${header.EventCategory} ==
 'SessionLogon'/simple
 
   /filter
 /route
 
 route id=B
   from
 

uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
 pp.sql.included.cds}} /
   bean ref=SecDefinitionFactory
 method=create/
   bean ref=MarketDataRequestFactory
 method=create/
 to uri=quickfix:config?. /
 /route   
 
 Geoffrey A Gershaw
 Credit eTrading Development
 +1 919 994 6412 (*102 6412)
 
 -Original Message-
 From: Bilgin Ibryam [mailto:bibr...@gmail.com] 
 Sent: Monday, January 14, 2013 11:17 AM
 To: users@camel.apache.org
 Subject: Re: Route Dependency in XML DSL
 
 Hi Geoffrey,
 
 what do you mean by route is finished ?
 Do you want to call route B at the end of rotue A?
 
 Bilgin
 
 On 14 January 2013 14:58, Gershaw, Geoffrey
 geoffrey.gers...@credit-suisse.com wrote:
 Geoffrey
 
 


 === 
 Please access the attached hyperlink for an important electronic
 communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html

JPA Component Behavior

2013-01-18 Thread Gershaw, Geoffrey
Hello once more,

 

 

So I read in the documentation that the jpa component polls the db.
Kinda a poor man's queue. I had hoped that this behavior would be
configurable. I don't want to poll. I just want to retrieve the entities
1 time. I would think the jpa component could do this.

 

It doesn't appear so. Am I correct? 

 

I guess I shall create a custom bean to do the retrieval?

 

Thanks


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Camel 2.10.3 ExchangeHelper.getMandatoryInBody is deprecated

2013-01-17 Thread Gershaw, Geoffrey
Hello All,

 

Apologies for the childishly simple question. J I moved to 2.10.3 and I
can't seem to locate the new javadoc on your site. Is this an oversight?

 

Thanks

 

Geoffrey A Gershaw

 


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Route Dependency in XML DSL

2013-01-14 Thread Gershaw, Geoffrey
Hello Camel Riders,

 

I have a route that I would like to start once another route is
finished.  I know I could change the jpa component into a custom bean,
but I want to do it the camel way J. I would essentially like to start
Route B From A.  IF they both start at the same time, the world may end
J

 

Thanks

route id =A

from uri=quickfix:config /

!-- On login, create MD Request --

filter

simple${header.EventCategory} ==
'SessionLogon'/simple


/filter

/route

 

route id=B

from
uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
pp.sql.included.cds}} /

bean ref=SecDefinitionFactory
method=create/

bean ref=MarketDataRequestFactory
method=create/

to uri=quickfix:config?. /

/route   

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
http://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 
=== 



RE: Route Dependency in XML DSL

2013-01-14 Thread Gershaw, Geoffrey
Yes, route a to call route b. I don't think it can be using the direct
component. I need the from of route b to use the jpa component.

route id =A
from uri=quickfix:config /
!-- On login, create MD Request --
filter
simple${header.EventCategory} ==
'SessionLogon'/simple

/filter
/route

route id=B
from
uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
pp.sql.included.cds}} /
bean ref=SecDefinitionFactory
method=create/
bean ref=MarketDataRequestFactory
method=create/
to uri=quickfix:config?. /
/route   

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)

-Original Message-
From: Bilgin Ibryam [mailto:bibr...@gmail.com] 
Sent: Monday, January 14, 2013 11:17 AM
To: users@camel.apache.org
Subject: Re: Route Dependency in XML DSL

Hi Geoffrey,

what do you mean by route is finished ?
Do you want to call route B at the end of rotue A?

Bilgin

On 14 January 2013 14:58, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Geoffrey

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Route Dependency in XML DSL

2013-01-14 Thread Gershaw, Geoffrey
Actually,

I should clarify, I don't want route B to start before route A is
finished. If Route B starts before Route A exits,  Route B will send
msgs to quickfix before quickfix is finished logging in.  Since Route B
has a JPA component as the from endpoint, as soon as its started, it
will start creating exchanges.

Therefore, I don't think it should start till A finishes. Unless you
could use some type of locking Mechanism.

-Original Message-
From: Gershaw, Geoffrey 
Sent: Monday, January 14, 2013 12:40 PM
To: users@camel.apache.org
Subject: RE: Route Dependency in XML DSL

Yes, route a to call route b. I don't think it can be using the direct
component. I need the from of route b to use the jpa component.

route id =A
from uri=quickfix:config /
!-- On login, create MD Request --
filter
simple${header.EventCategory} ==
'SessionLogon'/simple

/filter
/route

route id=B
from
uri=jpa://{{app.jpa.cdx.entity}}?consumeDelete=falseconsumer.query={{a
pp.sql.included.cds}} /
bean ref=SecDefinitionFactory
method=create/
bean ref=MarketDataRequestFactory
method=create/
to uri=quickfix:config?. /
/route   

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)

-Original Message-
From: Bilgin Ibryam [mailto:bibr...@gmail.com] 
Sent: Monday, January 14, 2013 11:17 AM
To: users@camel.apache.org
Subject: Re: Route Dependency in XML DSL

Hi Geoffrey,

what do you mean by route is finished ?
Do you want to call route B at the end of rotue A?

Bilgin

On 14 January 2013 14:58, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Geoffrey

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Error loading Quickfixj 1.5.2-all component sporatically

2012-08-30 Thread Gershaw, Geoffrey
Hi Willem,

Thanks for your reply. I just dug it out :)  I apologize about the release 
version of camel its Apache Camel 2.8.1. This is running from the jvm 1.6.0_10.

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Willem jiang [mailto:willem.ji...@gmail.com] 
Sent: Monday, August 27, 2012 11:07 PM
To: users@camel.apache.org
Subject: Re: Error loading Quickfixj 1.5.2-all component sporatically

First, we didn't release Camel 3.1, you may need to check your camel version 
again.

Second, I saw there are some complier threads, did you ran the Application from 
IDE?
Can you just run it directly from JVM ?


-- 
Willem Jiang

FuseSource
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Tuesday, August 28, 2012 at 12:06 AM, Gershaw, Geoffrey wrote:

 Hello All,
 
 
 We are using camel 3.1 for trading over a FIX connection. Every once in
 a while, the app stalls on startup.. We are not seeing any
 OutOfMemoryExceptions. We dropped a thread dump and I'm not seeing
 anything obvious. BTW Dropping the thread dump causes the app to wakeup
 and have no further issues for the day.
 
 
 Here is the Dump. I removed the GangWorker GC and CMS threads from
 output for brevity.
 
 
 Any help would be greatly appreciated. This might just be a quickfixj
 issue, and I've posted in their forum.
 
 
 Thanks,
 
 
 Geoff
 
 
 05:00:09,817 [main] DEBUG
 org.apache.camel.management.DefaultManagementAgent - Registered MBean
 with objectname:
 org.apache.camel:context=nyl01a-1103/camel,type=components,name=quickfi
 x
 
 05:00:09,817 [main] INFO
 org.apache.camel.component.quickfixj.QuickfixjComponent - QuickFIX/J
 component started
 
 05:00:09,817 [main] DEBUG org.apache.camel.impl.DefaultComponent -
 Creating endpoint
 uri=[quickfix://marketAxessCdsPriceConfig_US?sessionID=FIXT.1.1%3ACSUSCD
 SINV-%3EMA], path=[marketAxessCdsPriceConfig_US],
 parameters=[{sessionID=FIXT.1.1:CSUSCDSINV-MA}]
 
 05:00:09,817 [main] INFO
 org.apache.camel.component.quickfixj.QuickfixjComponent - Creating
 QuickFIX/J engine using settings: marketAxessCdsPriceConfig_US
 
 
 2012-08-27 08:49:25
 
 Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0-b15 mixed
 mode):
 
 
 Low Memory Detector daemon prio=10 tid=0x2aaaf8d01400 nid=0x79e5
 runnable [0x..0x00
 
 00]
 
 java.lang.Thread.State: RUNNABLE
 
 
 CompilerThread1 daemon prio=10 tid=0x2aaaf8a3a400 nid=0x79e4
 waiting on condition [0x..0x00
 
 0041d443e0]
 
 java.lang.Thread.State: RUNNABLE
 
 
 CompilerThread0 daemon prio=10 tid=0x2aaaf8a37800 nid=0x79e3
 waiting on condition [0x..0x00
 
 0041c433b0]
 
 java.lang.Thread.State: RUNNABLE
 
 
 JDWP Event Helper Thread daemon prio=10 tid=0x2aaaf8a22400
 nid=0x79e2 runnable [0x..0x0
 
 000]
 
 java.lang.Thread.State: RUNNABLE
 
 
 JDWP Transport Listener: dt_socket daemon prio=10
 tid=0x2aaaf8a1f000 nid=0x79e1 runnable [0x..0
 
 x]
 
 java.lang.Thread.State: RUNNABLE
 
 
 Signal Dispatcher daemon prio=10 tid=0x2aaaf8a11000 nid=0x79e0
 waiting on condition [0x..0x
 
 ]
 
 java.lang.Thread.State: RUNNABLE
 
 
 Surrogate Locker Thread (CMS) daemon prio=10 tid=0x2aaaf8a0f400
 nid=0x79df waiting on condition [0x
 
 ..0x41840fd8]
 
 java.lang.Thread.State: RUNNABLE
 
 
 Finalizer daemon prio=10 tid=0x2aaaf89f1c00 nid=0x79d6 in
 Object.wait() [0x4173f000..0x4173fca0
 
 ]
 
 java.lang.Thread.State: WAITING (on object monitor)
 
 at java.lang.Object.wait(Native Method)
 
 - waiting on 0x2aaab65a0018 (a
 java.lang.ref.ReferenceQueue$Lock)
 
 at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
 
 - locked 0x2aaab65a0018 (a
 java.lang.ref.ReferenceQueue$Lock)
 
 at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
 
 at
 java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
 
 
 Reference Handler daemon prio=10 tid=0x2aaaf89eac00 nid=0x79d5 in
 Object.wait() [0x4163e000..0x
 
 4163ec20]
 
 java.lang.Thread.State: WAITING (on object monitor)
 
 at java.lang.Object.wait(Native Method)
 
 - waiting on 0x2aaab65a3f18 (a
 java.lang.ref.Reference$Lock)
 
 at java.lang.Object.wait(Object.java:485)
 
 at
 java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
 
 - locked 0x2aaab65a3f18 (a java.lang.ref.Reference$Lock)
 
 
 
 main prio=10 tid=0x40121800 nid=0x79a2 runnable
 [0x40227000..0x4022af60]
 
 java.lang.Thread.State: RUNNABLE
 
 at java.lang.ClassLoader.defineClass1(Native Method)
 
 at java.lang.ClassLoader.defineClass(ClassLoader.java:621

RE: How to use Quickfix component

2012-08-30 Thread Gershaw, Geoffrey
And you have looked at the documentation for component, there are some
config examples there? If you are new to quickfixj, you should really
look at that documentation first. Are you new to FIX as well?

Geoffrey A Gershaw
Credit eTrading Development
+1 919 994 6412 (*102 6412)


-Original Message-
From: Mohammad Shadab Ali [mailto:mohammad@headstrong.com] 
Sent: Thursday, August 30, 2012 12:17 AM
To: Gershaw, Geoffrey; users@camel.apache.org
Subject: RE: How to use Quickfix component

Hi Gershaw,

I want to use the camel quickFIX/J component which uses the QuickFIX/J
FIX engine. This component uses the standard Financial Interchange (FIX)
protocol for message transport.


Regards,
Shadab

-Original Message-
From: Gershaw, Geoffrey [mailto:geoffrey.gers...@credit-suisse.com]
Sent: Wednesday, August 29, 2012 11:52 PM
To: Mohammad Shadab Ali
Subject: RE: How to use Quickfix component

Hi Mohammad,

Quickfixj or Quickfix?

-Original Message-
From: Mohammad Shadab Ali [mailto:mohammad@headstrong.com]
Sent: Wednesday, August 29, 2012 3:12 AM
To: users@camel.apache.org
Subject: How to use Quickfix component

Hi,

I am new to Quickfix. I want to use camel quickfix component to take
input from FIX simulator and pass on to Active MQ.

Routes as :-
Quickfix -- ActiveMQ

ActiveMQ  -- Quickfix

Can anybody please provide me a pointer for how to use Quickfix
component and camel test case for Quickfix component.



Regards,
Shadab



***The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review,retransmission,dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.***


===
Please access the attached hyperlink for an important electronic
communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html

===


***The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review,retransmission,dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.***

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Error loading Quickfixj 1.5.2-all component sporatically

2012-08-27 Thread Gershaw, Geoffrey
Hello All,

 

We are using camel 3.1 for trading over a FIX connection. Every once in
a while, the app stalls on startup.. We are not seeing any
OutOfMemoryExceptions. We dropped a thread dump and I'm not seeing
anything obvious. BTW Dropping the thread dump causes the app to wakeup
and have no further issues for the day.

 

Here is the Dump. I removed the GangWorker GC and CMS threads from
output for brevity.

 

Any help would be greatly appreciated. This might just be a quickfixj
issue, and I've posted in their forum.

 

Thanks,

 

Geoff

 

05:00:09,817 [main] DEBUG
org.apache.camel.management.DefaultManagementAgent  - Registered MBean
with objectname:
org.apache.camel:context=nyl01a-1103/camel,type=components,name=quickfi
x

05:00:09,817 [main] INFO
org.apache.camel.component.quickfixj.QuickfixjComponent  - QuickFIX/J
component started

05:00:09,817 [main] DEBUG org.apache.camel.impl.DefaultComponent  -
Creating endpoint
uri=[quickfix://marketAxessCdsPriceConfig_US?sessionID=FIXT.1.1%3ACSUSCD
SINV-%3EMA], path=[marketAxessCdsPriceConfig_US],
parameters=[{sessionID=FIXT.1.1:CSUSCDSINV-MA}]

05:00:09,817 [main] INFO
org.apache.camel.component.quickfixj.QuickfixjComponent  - Creating
QuickFIX/J engine using settings: marketAxessCdsPriceConfig_US

 

2012-08-27 08:49:25

Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0-b15 mixed
mode):

 

Low Memory Detector daemon prio=10 tid=0x2aaaf8d01400 nid=0x79e5
runnable [0x..0x00

00]

   java.lang.Thread.State: RUNNABLE

 

CompilerThread1 daemon prio=10 tid=0x2aaaf8a3a400 nid=0x79e4
waiting on condition [0x..0x00

0041d443e0]

   java.lang.Thread.State: RUNNABLE

 

CompilerThread0 daemon prio=10 tid=0x2aaaf8a37800 nid=0x79e3
waiting on condition [0x..0x00

0041c433b0]

   java.lang.Thread.State: RUNNABLE

 

JDWP Event Helper Thread daemon prio=10 tid=0x2aaaf8a22400
nid=0x79e2 runnable [0x..0x0

000]

   java.lang.Thread.State: RUNNABLE

 

JDWP Transport Listener: dt_socket daemon prio=10
tid=0x2aaaf8a1f000 nid=0x79e1 runnable [0x..0

x]

   java.lang.Thread.State: RUNNABLE

 

Signal Dispatcher daemon prio=10 tid=0x2aaaf8a11000 nid=0x79e0
waiting on condition [0x..0x

]

   java.lang.Thread.State: RUNNABLE

 

Surrogate Locker Thread (CMS) daemon prio=10 tid=0x2aaaf8a0f400
nid=0x79df waiting on condition [0x

..0x41840fd8]

   java.lang.Thread.State: RUNNABLE

 

Finalizer daemon prio=10 tid=0x2aaaf89f1c00 nid=0x79d6 in
Object.wait() [0x4173f000..0x4173fca0

]

   java.lang.Thread.State: WAITING (on object monitor)

at java.lang.Object.wait(Native Method)

- waiting on 0x2aaab65a0018 (a
java.lang.ref.ReferenceQueue$Lock)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)

- locked 0x2aaab65a0018 (a
java.lang.ref.ReferenceQueue$Lock)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)

at
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

 

Reference Handler daemon prio=10 tid=0x2aaaf89eac00 nid=0x79d5 in
Object.wait() [0x4163e000..0x

4163ec20]

   java.lang.Thread.State: WAITING (on object monitor)

at java.lang.Object.wait(Native Method)

- waiting on 0x2aaab65a3f18 (a
java.lang.ref.Reference$Lock)

at java.lang.Object.wait(Object.java:485)

at
java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)

- locked 0x2aaab65a3f18 (a java.lang.ref.Reference$Lock)

 

 

main prio=10 tid=0x40121800 nid=0x79a2 runnable
[0x40227000..0x4022af60]

   java.lang.Thread.State: RUNNABLE

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

- locked 0x2aaab65a2510 (a
sun.misc.Launcher$AppClassLoader)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

- locked 0x2aaab65a2510 (a
sun.misc.Launcher$AppClassLoader)

at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

- locked 0x2aaab65a2510 (a
sun.misc.Launcher$AppClassLoader)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:169)

RE: Simple language question

2012-06-19 Thread Gershaw, Geoffrey
Thanks for reply Claus,

I see your point. I was trying to avoid writing a nested filter.

filter
simple${body} != null/simple
filter
method ref= CXRefDataCache method= put/
to uri=somewhere
/filter
filter

I guess I am looking for a local variable where I could store the result
of a predicate on 1 line and use that local variable in the simple
expression of the filter.

Making sense?

Thanks again


simple${body} != null and false ==
 ${bean:CXRefDataCache?method=put}/simple
Geoffrey A. Gershaw
Credit eTrading Dev - RDO
1 919 994 6412

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Monday, June 18, 2012 11:35 PM
To: users@camel.apache.org
Subject: Re: Simple language question

On Mon, Jun 18, 2012 at 11:49 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello all,



 I am using the Spring DSL with the Filter EIP. The below snippet
works,
 but  its confusing. I am trying to include a msg with a non-null body
 the outcome of bean:CXRefDataCache?method=put  equals false.



 Is there a cleaner way?



Why is that confusing? You have 2 predicates to test for. And that is
what
you use in the simple expression.
You can put that logic behind a single bean method and give the method a
meaningful name

filter
  method ref=myBean method=someMeaningfulNameHere/
   ...
/filter

And there is many other scripting languages you can use, if you think
they
can provide a less confusing way
http://camel.apache.org/languages


 filter

 !-- Only process valid (non-null) SecDefs. cache CXRefdata. Return
true
 if its an update--

  simple${body} != null and false ==
 ${bean:CXRefDataCache?method=put}/simple

 



 Thanks



 Geoffrey A. Gershaw







===
 Please access the attached hyperlink for an important electronic
 communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html



===




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
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 
=== 



Simple language question

2012-06-18 Thread Gershaw, Geoffrey
Hello all,

 

I am using the Spring DSL with the Filter EIP. The below snippet works,
but  its confusing. I am trying to include a msg with a non-null body
the outcome of bean:CXRefDataCache?method=put  equals false.

 

Is there a cleaner way?

 

filter

!-- Only process valid (non-null) SecDefs. cache CXRefdata. Return true
if its an update--

  simple${body} != null and false ==
${bean:CXRefDataCache?method=put}/simple



 

Thanks

 

Geoffrey A. Gershaw

 


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Unit testing a method with Exchange as a Param

2012-05-25 Thread Gershaw, Geoffrey
Christian,

You are a gentleman and a scholar. I need to be a better Camel Rider. I didn't 
realize how easy it is to Unit test. I thought I'd have to launch the whole 
Spring dependency.

Thanks again

Geoffrey A. Gershaw
Credit eTrading Dev - RDO
1 919 994 6412


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Thursday, May 24, 2012 6:40 PM
To: users@camel.apache.org
Subject: Re: Unit testing a method with Exchange as a Param

I wouldn't mock the Exchange:

CamelContext ctx = new CamelContext();
Exchange ex = new DefaultExchange(ctx);

// your code...

Best,
Christian

On Thu, May 24, 2012 at 11:31 PM, Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com wrote:

 Hello all,

 I am trying to unit test the following method, which is essentially the
 Sending to multiple JMS destinations from one endpoint example from the
 camel website.  Since the Exchange object is a param and contains the
 result, I'm having trouble Mocking it. The below test fails at the ***
 line. actualTopicName is null :( . Essentially all the publish method is
 doing, is adding headers to the In Msg of the Exchange object.

 Appreciate the advice.

 Geoff



@Test
public void testSingleTopicPublish(){
MarketData md = createMarketData();

Exchange exchange = mock(Exchange.class);
Message inMsg = mock(Message.class);


when(exchange.getIn()).thenReturn(inMsg);
when(inMsg.getBody(Publishable.class)).thenReturn(md);


String singleTopic = TEST.TOPIC;
destinationResolver = new
 JMSDestinationResolver(singleTopic,PublishType.SINGLE_DESTINATION);
destinationResolver.publish(exchange);

Message actualInMsg = exchange.getIn();
String actualTopicName = (String)
 actualInMsg.getHeader(JmsConstants.JMS_DESTINATION_NAME);

assertEquals(singleTopic, actualTopicName);
 


}


/**
 * Send exchange to a JMS Destination determined at Runtime
 * @param exchange
 */
public void publish(Exchange exchange){
Publishable publishable=
 exchange.getIn().getBody(Publishable.class);
MapString,String origMsgHeaders =
 publishable.getPublishProperties();
MapString,Object msgHeaders = new HashMapString,
 Object(origMsgHeaders);
String destinationName = null;

//If we are publishing on muiltiple topics and there is
 no destinationPrefix can't publish this msg
if(publishType == PublishType.MULTIPLE_DESTINATIONS){

 if(!StringUtils.isEmpty(publishable.getPublishTopicName())){
destinationName = String.format(%s.%s,
 destinationPrefix, publishable.getPublishTopicName());
}else{
log.error(Empty topicName for msg:  +
 publishable);
}
}
else{
//The we are publishing on 1 topic, grab it from
 config
destinationName = destinationPrefix;
}

if(log.isDebugEnabled()){
log.debug(Destination is  + destinationName);
}
msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
 destinationName);
exchange.getIn().setHeaders(msgHeaders);
}


 ===
 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: Unit testing a method with Exchange as a Param

2012-05-25 Thread Gershaw, Geoffrey
Yeah, I figured that one out

Geoffrey A. Gershaw
Credit eTrading Dev - RDO
1 919 994 6412


-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Friday, May 25, 2012 9:44 AM
To: users@camel.apache.org
Subject: RE: Unit testing a method with Exchange as a Param

You are welcome. And replace in my last post
CamelContext ctx = new CamelContext();
with
CamelContext ctx = new DefaultCamelContext();

It was a bit too late yesterday... ;-)

Best,
Chrostian
Sent from a mobile device
Am 25.05.2012 14:15 schrieb Gershaw, Geoffrey 
geoffrey.gers...@credit-suisse.com:

 Christian,

 You are a gentleman and a scholar. I need to be a better Camel Rider. I
 didn't realize how easy it is to Unit test. I thought I'd have to launch
 the whole Spring dependency.

 Thanks again

 Geoffrey A. Gershaw
 Credit eTrading Dev - RDO
 1 919 994 6412


 -Original Message-
 From: Christian Müller [mailto:christian.muel...@gmail.com]
 Sent: Thursday, May 24, 2012 6:40 PM
 To: users@camel.apache.org
 Subject: Re: Unit testing a method with Exchange as a Param

 I wouldn't mock the Exchange:

 CamelContext ctx = new CamelContext();
 Exchange ex = new DefaultExchange(ctx);

 // your code...

 Best,
 Christian

 On Thu, May 24, 2012 at 11:31 PM, Gershaw, Geoffrey 
 geoffrey.gers...@credit-suisse.com wrote:

  Hello all,
 
  I am trying to unit test the following method, which is essentially the
  Sending to multiple JMS destinations from one endpoint example from the
  camel website.  Since the Exchange object is a param and contains the
  result, I'm having trouble Mocking it. The below test fails at the ***
  line. actualTopicName is null :( . Essentially all the publish method is
  doing, is adding headers to the In Msg of the Exchange object.
 
  Appreciate the advice.
 
  Geoff
 
 
 
 @Test
 public void testSingleTopicPublish(){
 MarketData md = createMarketData();
 
 Exchange exchange = mock(Exchange.class);
 Message inMsg = mock(Message.class);
 
 
 when(exchange.getIn()).thenReturn(inMsg);
 when(inMsg.getBody(Publishable.class)).thenReturn(md);
 
 
 String singleTopic = TEST.TOPIC;
 destinationResolver = new
  JMSDestinationResolver(singleTopic,PublishType.SINGLE_DESTINATION);
 destinationResolver.publish(exchange);
 
 Message actualInMsg = exchange.getIn();
 String actualTopicName = (String)
  actualInMsg.getHeader(JmsConstants.JMS_DESTINATION_NAME);
 
 assertEquals(singleTopic, actualTopicName);
  
 
 
 }
 
 
 /**
  * Send exchange to a JMS Destination determined at Runtime
  * @param exchange
  */
 public void publish(Exchange exchange){
 Publishable publishable=
  exchange.getIn().getBody(Publishable.class);
 MapString,String origMsgHeaders =
  publishable.getPublishProperties();
 MapString,Object msgHeaders = new HashMapString,
  Object(origMsgHeaders);
 String destinationName = null;
 
 //If we are publishing on muiltiple topics and there is
  no destinationPrefix can't publish this msg
 if(publishType == PublishType.MULTIPLE_DESTINATIONS){
 
  if(!StringUtils.isEmpty(publishable.getPublishTopicName())){
 destinationName = String.format(%s.%s,
  destinationPrefix, publishable.getPublishTopicName());
 }else{
 log.error(Empty topicName for msg:  +
  publishable);
 }
 }
 else{
 //The we are publishing on 1 topic, grab it from
  config
 destinationName = destinationPrefix;
 }
 
 if(log.isDebugEnabled()){
 log.debug(Destination is  + destinationName);
 }
 msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
  destinationName);
 exchange.getIn().setHeaders(msgHeaders);
 }
 
 
 
 ===
  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

 ===



=== 
Please access

Unit testing a method with Exchange as a Param

2012-05-24 Thread Gershaw, Geoffrey
Hello all,

I am trying to unit test the following method, which is essentially the
Sending to multiple JMS destinations from one endpoint example from the
camel website.  Since the Exchange object is a param and contains the
result, I'm having trouble Mocking it. The below test fails at the ***
line. actualTopicName is null :( . Essentially all the publish method is
doing, is adding headers to the In Msg of the Exchange object. 

Appreciate the advice.

Geoff



@Test
public void testSingleTopicPublish(){
MarketData md = createMarketData();
 
Exchange exchange = mock(Exchange.class);
Message inMsg = mock(Message.class);


when(exchange.getIn()).thenReturn(inMsg);
when(inMsg.getBody(Publishable.class)).thenReturn(md);


String singleTopic = TEST.TOPIC;
destinationResolver = new
JMSDestinationResolver(singleTopic,PublishType.SINGLE_DESTINATION);
destinationResolver.publish(exchange);

Message actualInMsg = exchange.getIn();
String actualTopicName = (String)
actualInMsg.getHeader(JmsConstants.JMS_DESTINATION_NAME); 

assertEquals(singleTopic, actualTopicName);



}


/**
 * Send exchange to a JMS Destination determined at Runtime
 * @param exchange
 */
public void publish(Exchange exchange){
Publishable publishable=
exchange.getIn().getBody(Publishable.class);
MapString,String origMsgHeaders =
publishable.getPublishProperties();
MapString,Object msgHeaders = new HashMapString,
Object(origMsgHeaders);
String destinationName = null;

//If we are publishing on muiltiple topics and there is
no destinationPrefix can't publish this msg
if(publishType == PublishType.MULTIPLE_DESTINATIONS){

if(!StringUtils.isEmpty(publishable.getPublishTopicName())){
destinationName = String.format(%s.%s,
destinationPrefix, publishable.getPublishTopicName());
}else{
log.error(Empty topicName for msg:  +
publishable);
}
}
else{
//The we are publishing on 1 topic, grab it from
config
destinationName = destinationPrefix;
}

if(log.isDebugEnabled()){
log.debug(Destination is  + destinationName);
}
msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
destinationName);
exchange.getIn().setHeaders(msgHeaders);
}

=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: JMS Endpoint Reuse and sending to different destinations @ Runtime

2012-04-27 Thread Gershaw, Geoffrey
 to create 
destination; nested exception is javax.jms.InvalidDestinationException: Not 
allowed to create destination



-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Friday, April 27, 2012 1:58 AM
To: users@camel.apache.org
Subject: Re: JMS Endpoint Reuse and sending to different destinations @ Runtime

On Thu, Apr 26, 2012 at 11:02 PM, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Hi Claus,

 Thanks for the reply. I agree there is a permissions issue on the JMS Broker. 
 The problem is that I can't see in the logs the name of the topic where I'm 
 publishing.


Well thats maybe because Camel dont reach so far that it tries to send
the message, but the JMS Client fails beforehand with that permission
error.
It ought to be the client that reported a better exception message
with the destination name.

Well it reminds me of Oracle's exception with Table or view does not exist.

Camel has the logging it offers if  you enable TRACE or DEBUG logging
on the org.apache.camel.component.jms package.



 I am using the ProducerTemplate
  msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME, destinationName);
  jmsProducer.sendBodyAndHeaders(endPointUri, publishable.getPayload(), 
 msgHeaders);

 I can see the value of destinationName in the below log line
 15:03:46,115 [QFJ Message Processor] DEBUG 
 com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is  
 T.NY.COLT.FBID.REDC.2I65BYCO1

 But it looks like ultimately its trying to send jmsUS://topic

 15:03:46,117 [QFJ Message Processor] DEBUG  
 org.apache.camel.impl.ProducerCache  - Adding to producer cache with  key: 
 Endpoint[jmsUS://topic] for producer: Producer[jmsUS://topic]
 15:03:46,120 [QFJ Message Processor] DEBUG 
 org.apache.camel.impl.ProducerCache  -  Endpoint[jmsUS://topic] 
 Exchange[Message:8=FIXT.1.19=17835=S15=USD22=R48=2I65BYCO155=60200560=20120425-19:03:46.051117=15648175132=95134=5167=INDEX_CDS423=6537=1632=0647=06372=Y7100=CX7101=UPD7102=156481757528=010=202]

 Any ideas?

 Thanks


 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Thursday, April 26, 2012 3:20 AM
 To: users@camel.apache.org
 Subject: Re: JMS Endpoint Reuse and sending to different destinations @ 
 Runtime

 Hi

 This seems like a permission/security setting. That your JMS broker
 denies sending to non existing topics.
 javax.jms.InvalidDestinationException: Not allowed to create destination

 You may need to create the destination on the JMS broker using its
 admin interface for that.


 On Wed, Apr 25, 2012 at 9:11 PM, Gershaw, Geoffrey
 geoffrey.gers...@credit-suisse.com wrote:
 Hello,



 I am trying to do what the subject of this mail says. I have looked at
 the documentation on the JMS component @
 http://camel.apache.org/jms.html.



 I have a collection of Publishable objects. Publishable objects have



 1.       A method that returns the Topic name postfix.

 2.       A method that returns a MapString,String of properties to put
 as JMS Headers



 Based on what I read, I created the below class. I am using the
 ProducerTemplate to publish





 public class GenericCamelPublisher {

      private ProducerTemplate jmsProducer;

      private static final Logger log =
 Logger.getLogger(GenericCamelPublisher.class);

      private String destinationPrefix;

      private String endPointUri;



      public GenericCamelPublisher(ProducerTemplate jmsProducer, String
 destinationPrefix, String endPointUri){

            this.jmsProducer = jmsProducer;

            this.destinationPrefix = destinationPrefix;

            this.endPointUri = endPointUri;

      }



      public void publish(Publishable publishable){

            MapString,String origMsgHeaders =
 publishable.getPublishProperties();

            MapString,Object msgHeaders = new HashMapString,
 Object(origMsgHeaders);

            String destinationName = null;



            if(!StringUtils.isEmpty(destinationPrefix)){

                  destinationName = String.format(%s.%s,
 destinationPrefix, publishable.getPublishTopicName());

            }else{

                  destinationName = publishable.getPublishTopicName();

            }



            if(log.isDebugEnabled()){

                  log.debug(Destination is  + destinationName);

            }

            msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
 destinationName);

            jmsProducer.sendBodyAndHeaders(endPointUri,
 publishable.getPayload(), msgHeaders);

      }

 }



 I receive the following output



 15:03:46,115 [QFJ Message Processor] DEBUG
 com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is
 T.NY.COLT.FBID.REDC.2I65BYCO1

 15:03:46,115 [QFJ Message Processor] DEBUG
 org.apache.camel.impl.DefaultComponent  - Creating endpoint
 uri=[jmsUS://topic], path=[topic], parameters=[{}]

 15:03:46,116 [QFJ Message Processor] DEBUG
 org.apache.camel.spring.SpringCamelContext  - jmsUS://topic converted to
 endpoint

RE: JMS Endpoint Reuse and sending to different destinations @ Runtime

2012-04-26 Thread Gershaw, Geoffrey
Hi Claus,

Thanks for the reply. I agree there is a permissions issue on the JMS Broker. 
The problem is that I can't see in the logs the name of the topic where I'm 
publishing.

I am using the ProducerTemplate 
  msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME, destinationName);
  jmsProducer.sendBodyAndHeaders(endPointUri, publishable.getPayload(), 
msgHeaders);

I can see the value of destinationName in the below log line 
15:03:46,115 [QFJ Message Processor] DEBUG 
com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is  
T.NY.COLT.FBID.REDC.2I65BYCO1

But it looks like ultimately its trying to send jmsUS://topic

15:03:46,117 [QFJ Message Processor] DEBUG  org.apache.camel.impl.ProducerCache 
 - Adding to producer cache with  key: Endpoint[jmsUS://topic] for producer: 
Producer[jmsUS://topic]
15:03:46,120 [QFJ Message Processor] DEBUG org.apache.camel.impl.ProducerCache  
-  Endpoint[jmsUS://topic] 
Exchange[Message:8=FIXT.1.19=17835=S15=USD22=R48=2I65BYCO155=60200560=20120425-19:03:46.051117=15648175132=95134=5167=INDEX_CDS423=6537=1632=0647=06372=Y7100=CX7101=UPD7102=156481757528=010=202]

Any ideas?

Thanks


-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Thursday, April 26, 2012 3:20 AM
To: users@camel.apache.org
Subject: Re: JMS Endpoint Reuse and sending to different destinations @ Runtime

Hi

This seems like a permission/security setting. That your JMS broker
denies sending to non existing topics.
 javax.jms.InvalidDestinationException: Not allowed to create destination

You may need to create the destination on the JMS broker using its
admin interface for that.


On Wed, Apr 25, 2012 at 9:11 PM, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Hello,



 I am trying to do what the subject of this mail says. I have looked at
 the documentation on the JMS component @
 http://camel.apache.org/jms.html.



 I have a collection of Publishable objects. Publishable objects have



 1.       A method that returns the Topic name postfix.

 2.       A method that returns a MapString,String of properties to put
 as JMS Headers



 Based on what I read, I created the below class. I am using the
 ProducerTemplate to publish





 public class GenericCamelPublisher {

      private ProducerTemplate jmsProducer;

      private static final Logger log =
 Logger.getLogger(GenericCamelPublisher.class);

      private String destinationPrefix;

      private String endPointUri;



      public GenericCamelPublisher(ProducerTemplate jmsProducer, String
 destinationPrefix, String endPointUri){

            this.jmsProducer = jmsProducer;

            this.destinationPrefix = destinationPrefix;

            this.endPointUri = endPointUri;

      }



      public void publish(Publishable publishable){

            MapString,String origMsgHeaders =
 publishable.getPublishProperties();

            MapString,Object msgHeaders = new HashMapString,
 Object(origMsgHeaders);

            String destinationName = null;



            if(!StringUtils.isEmpty(destinationPrefix)){

                  destinationName = String.format(%s.%s,
 destinationPrefix, publishable.getPublishTopicName());

            }else{

                  destinationName = publishable.getPublishTopicName();

            }



            if(log.isDebugEnabled()){

                  log.debug(Destination is  + destinationName);

            }

            msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
 destinationName);

            jmsProducer.sendBodyAndHeaders(endPointUri,
 publishable.getPayload(), msgHeaders);

      }

 }



 I receive the following output



 15:03:46,115 [QFJ Message Processor] DEBUG
 com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is
 T.NY.COLT.FBID.REDC.2I65BYCO1

 15:03:46,115 [QFJ Message Processor] DEBUG
 org.apache.camel.impl.DefaultComponent  - Creating endpoint
 uri=[jmsUS://topic], path=[topic], parameters=[{}]

 15:03:46,116 [QFJ Message Processor] DEBUG
 org.apache.camel.spring.SpringCamelContext  - jmsUS://topic converted to
 endpoint: Endpoint[jmsUS://topic] by component:
 org.apache.camel.component.jms.JmsComponent@1d281f1

 15:03:46,117 [QFJ Message Processor] DEBUG
 org.apache.camel.component.jms.JmsProducer  - Starting producer:
 Producer[jmsUS://topic]

 15:03:46,117 [QFJ Message Processor] DEBUG
 org.apache.camel.impl.ProducerCache  - Adding to producer cache with
 key: Endpoint[jmsUS://topic] for producer: Producer[jmsUS://topic]

 15:03:46,120 [QFJ Message Processor] DEBUG
 org.apache.camel.impl.ProducerCache  -  Endpoint[jmsUS://topic]
 Exchange[Message:
 8=FIXT.1.19=17835=S15=USD22=R48=2I65BYCO155=60200560=20120425-19:03:46.0
 51117=15648175132=95134=5167=INDEX_CDS423=6537=1632=0647=06372=Y7100
 =CX7101=UPD7102=156481757528=010=202]

 15:03:46,316 [QFJ Message Processor] DEBUG
 org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate  -
 Executing callback on JMS Session

JMS Endpoint Reuse and sending to different destinations @ Runtime

2012-04-25 Thread Gershaw, Geoffrey
Hello,

 

I am trying to do what the subject of this mail says. I have looked at
the documentation on the JMS component @
http://camel.apache.org/jms.html.

 

I have a collection of Publishable objects. Publishable objects have 

 

1.   A method that returns the Topic name postfix. 

2.   A method that returns a MapString,String of properties to put
as JMS Headers

 

Based on what I read, I created the below class. I am using the
ProducerTemplate to publish

 

 

public class GenericCamelPublisher {

  private ProducerTemplate jmsProducer;

  private static final Logger log =
Logger.getLogger(GenericCamelPublisher.class);

  private String destinationPrefix;

  private String endPointUri;

 

  public GenericCamelPublisher(ProducerTemplate jmsProducer, String
destinationPrefix, String endPointUri){

this.jmsProducer = jmsProducer;

this.destinationPrefix = destinationPrefix;

this.endPointUri = endPointUri;

  }

 

  public void publish(Publishable publishable){

MapString,String origMsgHeaders =
publishable.getPublishProperties();

MapString,Object msgHeaders = new HashMapString,
Object(origMsgHeaders);

String destinationName = null;

 

if(!StringUtils.isEmpty(destinationPrefix)){

  destinationName = String.format(%s.%s,
destinationPrefix, publishable.getPublishTopicName());

}else{

  destinationName = publishable.getPublishTopicName();

}

 

if(log.isDebugEnabled()){

  log.debug(Destination is  + destinationName);

}

msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
destinationName);

jmsProducer.sendBodyAndHeaders(endPointUri,
publishable.getPayload(), msgHeaders);

  }

}

 

I receive the following output

 

15:03:46,115 [QFJ Message Processor] DEBUG
com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is
T.NY.COLT.FBID.REDC.2I65BYCO1

15:03:46,115 [QFJ Message Processor] DEBUG
org.apache.camel.impl.DefaultComponent  - Creating endpoint
uri=[jmsUS://topic], path=[topic], parameters=[{}]

15:03:46,116 [QFJ Message Processor] DEBUG
org.apache.camel.spring.SpringCamelContext  - jmsUS://topic converted to
endpoint: Endpoint[jmsUS://topic] by component:
org.apache.camel.component.jms.JmsComponent@1d281f1

15:03:46,117 [QFJ Message Processor] DEBUG
org.apache.camel.component.jms.JmsProducer  - Starting producer:
Producer[jmsUS://topic]

15:03:46,117 [QFJ Message Processor] DEBUG
org.apache.camel.impl.ProducerCache  - Adding to producer cache with
key: Endpoint[jmsUS://topic] for producer: Producer[jmsUS://topic]

15:03:46,120 [QFJ Message Processor] DEBUG
org.apache.camel.impl.ProducerCache  -  Endpoint[jmsUS://topic]
Exchange[Message:
8=FIXT.1.19=17835=S15=USD22=R48=2I65BYCO155=60200560=20120425-19:03:46.0
51117=15648175132=95134=5167=INDEX_CDS423=6537=1632=0647=06372=Y7100
=CX7101=UPD7102=156481757528=010=202]

15:03:46,316 [QFJ Message Processor] DEBUG
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate  -
Executing callback on JMS Session:
com.tibco.tibjms.TibjmsxSessionImp@1846149

15:03:46,377 [QFJ Message Processor] WARN
org.apache.camel.processor.UnitOfWorkProcessor  - Caught unhandled
exception while processing ExchangeId:
ID-USD09546426-64302-1335380610999-0-4234

org.springframework.jms.InvalidDestinationException: Not allowed to
create destination; nested exception is
javax.jms.InvalidDestinationException: Not allowed to create destination

at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUt
ils.java:285)

at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(Jm
sAccessor.java:168)

at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)

 

I have seen this exception if I try to publish to a topic that does not
begin with T.NY.COLT. It's a permissioning thing. 

In this case, the logs don't tell where the jmsEndpoint tried to publish
too.

 

Am I approaching this the wrong way?

 

Thanks in advance,


Geoff

 

 

 

Geoffrey A. Gershaw

 


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



JMS Endpoint Reuse and sending to different destinations at runtime(Didn't make it to the list 1st time)

2012-04-25 Thread Gershaw, Geoffrey
 

Hello,

 

I am trying to do what the subject of this mail says. I have looked at
the documentation on the JMS component.

 

I have a collection of Publishable objects. Publishable objects have 

 

1.   A method that returns the Topic name postfix. 

2.   A method that returns a MapString,String of properties to put
as JMS Headers

 

Based on what I read, I created the below class. I am using the
ProducerTemplate to publish

 

 

public class GenericCamelPublisher {

  private ProducerTemplate jmsProducer;

  private static final Logger log =
Logger.getLogger(GenericCamelPublisher.class);

  private String destinationPrefix;

  private String endPointUri;

 

  public GenericCamelPublisher(ProducerTemplate jmsProducer, String
destinationPrefix, String endPointUri){

this.jmsProducer = jmsProducer;

this.destinationPrefix = destinationPrefix;

this.endPointUri = endPointUri;

  }

 

  public void publish(Publishable publishable){

MapString,String origMsgHeaders =
publishable.getPublishProperties();

MapString,Object msgHeaders = new HashMapString,
Object(origMsgHeaders);

String destinationName = null;

 

if(!StringUtils.isEmpty(destinationPrefix)){

  destinationName = String.format(%s.%s,
destinationPrefix, publishable.getPublishTopicName());

}else{

  destinationName = publishable.getPublishTopicName();

}

 

if(log.isDebugEnabled()){

  log.debug(Destination is  + destinationName);

}

msgHeaders.put(JmsConstants.JMS_DESTINATION_NAME,
destinationName);

jmsProducer.sendBodyAndHeaders(endPointUri,
publishable.getPayload(), msgHeaders);

  }

}

 

I receive the following output

 

15:03:46,115 [QFJ Message Processor] DEBUG
com.csfb.oddlots.creditex.md.GenericCamelPublisher  - Destination is
T.NY.COLT.FBID.REDC.2I65BYCO1

15:03:46,115 [QFJ Message Processor] DEBUG
org.apache.camel.impl.DefaultComponent  - Creating endpoint
uri=[jmsUS://topic], path=[topic], parameters=[{}]

15:03:46,116 [QFJ Message Processor] DEBUG
org.apache.camel.spring.SpringCamelContext  - jmsUS://topic converted to
endpoint: Endpoint[jmsUS://topic] by component:
org.apache.camel.component.jms.JmsComponent@1d281f1

15:03:46,117 [QFJ Message Processor] DEBUG
org.apache.camel.component.jms.JmsProducer  - Starting producer:
Producer[jmsUS://topic]

15:03:46,117 [QFJ Message Processor] DEBUG
org.apache.camel.impl.ProducerCache  - Adding to producer cache with
key: Endpoint[jmsUS://topic] for producer: Producer[jmsUS://topic]

15:03:46,120 [QFJ Message Processor] DEBUG
org.apache.camel.impl.ProducerCache  -  Endpoint[jmsUS://topic]
Exchange[Message:
8=FIXT.1.19=17835=S15=USD22=R48=2I65BYCO155=60200560=20120425-19:03:46.0
51117=15648175132=95134=5167=INDEX_CDS423=6537=1632=0647=06372=Y7100
=CX7101=UPD7102=156481757528=010=202]

15:03:46,316 [QFJ Message Processor] DEBUG
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate  -
Executing callback on JMS Session:
com.tibco.tibjms.TibjmsxSessionImp@1846149

15:03:46,377 [QFJ Message Processor] WARN
org.apache.camel.processor.UnitOfWorkProcessor  - Caught unhandled
exception while processing ExchangeId:
ID-USD09546426-64302-1335380610999-0-4234

org.springframework.jms.InvalidDestinationException: Not allowed to
create destination; nested exception is
javax.jms.InvalidDestinationException: Not allowed to create destination

at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUt
ils.java:285)

at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(Jm
sAccessor.java:168)

at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)

 

I have seen this exception if I try to publish to a topic that does not
begin with T.NY.COLT. It's a permissioning thing. 

In this case, the logs don't tell where the jmsEndpoint tried to publish
too.

 

Am I approaching this the wrong way?

 

Thanks in advance,


Geoff

 

 

 

Geoffrey A. Gershaw

 


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Splitter Spring Config

2012-04-19 Thread Gershaw, Geoffrey
Hello All,

 

I am trying to use my pojo to do the splitting as mentioned
http://camel.apache.org/splitter.html
http://camel.apache.org/splitter.html  under Using a Pojo to do the
splitting. There is no example of  how to wire in my pojo using Spring
config. I only see the java DSL. Has anyone done this?

Secondly, I want to call a bean (GenericCamelPublisher ) for every
iteration of the split. I thought this would work, but it complains. Any
ideas?

 

split 

bean ref=GenericCamelPublisher/

  to uri=jmsUS:topic:dummy/

/split

Thanks

 

Geoffrey A. Gershaw

CREDIT SUISSE

Information Technology | Credit eTrading Dev - NY, KVBM 341

One Madison Avenue | 10010 New York | United States

Phone +1 212 538 6727

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 
=== 



QuickFIXJ Filtering

2012-03-14 Thread Gershaw, Geoffrey
Hello,

 

I would like to filter out a message if the FIX field 9101=N. I am able
to do this by creating a bean that does this and calling the bean from
the simple tag using the bean reference. See example below. I wondered
if it would be possible to do this without the java class. 

 

filter

simple${bean:SecurityDefinitionFilter}/simple

 

 

filter

  simple${body}??/simple

 

 

Thanks for any help you can offer.

 

Regards




=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Dealing with a bean's return values

2012-02-07 Thread Gershaw, Geoffrey
Hello,

 

Hoping that someone can help me with beans in my route. I have created
the following route. I am using 3 beans in the route. 

 

1.   SecurityDefinitionFilter returns Boolean if we are interested
in this SecurityDefinition

2.  SecDefConverter transforms SecurityDefinition to a CXRefData object.
Returns null if there is a problem during transformation.

3.  CXRefDataCache caches the CXRefData object. Doesn't handle null.

 

route 

  from uri=direct:processSecurityDefinition /

filter

 
simple${bean:SecurityDefinitionFilter}/simple!--  Only process CDX
--

  bean ref=SecDefConverter
method=convert/!--  SecDef to CXRefData   --

  bean ref=CXRefDataCache
method=put/!-- Cache RefData--

/filter

/route

If a null value is returned by SecDefConverter.convert, I would like to
filter out(stop moving forward in the route).

If a non-null value is returned from SecDefConverter.convert, it  should
be passed to CXRefDataCache

 

Thanks,

 

Geoff


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



RE: Passing parameter values to bean methods via spring

2012-02-01 Thread Gershaw, Geoffrey
Thanks for the reply. Could you give me an example for 1c? I mocked up an 
example. Assume the below  XML comes from the ftp site. The XMLFilter's match 
method accepts the username. How can I use XPath to pass the user to the match 
method? 


 Example

Userjoe/User

 /Example

Class XMLFilter{

public boolean match(String username){
//check db for user
//if found return true/else false
}
}

route

fromftp://rider.com/orders?username=riderpassword=secret;/from
filter
simple${bean:xmlFilter?method=match}/simple
to uri=log:worked/
/filter
/route

Thanks

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Wednesday, February 01, 2012 3:20 AM
To: users@camel.apache.org
Subject: Re: Passing parameter values to bean methods via spring

Hi

On Tue, Jan 31, 2012 at 5:10 PM, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Hello,



 I am a newbie to Camel. I've read a bunch of docs, but have not found an
 answer to this specific use case.


Welcome to the community.



 1.       Assume the following.

 a.       I have the belown XML msg in the body of my Message.

 Example

                Userjoe/User

 /Example

 b.      I am using a bean as a Filter. The method signature is

                                                               i.
 public boolean validateUser(String user)

 c.       Ideally I would like to user xpath in the config file to pass
 Joe to the validateUser method


Yes xpath works fine for grabbing content from a XML doc.
However  where it get tricky is if your XML uses namespaces. If so
your XPath expression *must* also use namespaces.


 d.      If the method returns false, I would like the route to stop.
 Don't know how to do this.


You can use a Content Based Router, and in the otherwise leg, you can
use the stop DSL.


 e.      If the method returns true, I would like to pass the original
 XML msg to a processor and finish the route.


Yes this happens already, the filter predicate is just for determine
true | false

 f.        Is this possible?



Yes, something a like

from X
  choice
 when bean (myFilterBean)
   to Y
otherwise
  stop






 Thanks

 Geoff Gershaw


 ===
 Please access the attached hyperlink for an important electronic 
 communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
 ===




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.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: Passing parameter values to bean methods via spring

2012-02-01 Thread Gershaw, Geoffrey
Thanks Claus,

I was trying to keep out the Camel annotations. I wanted to have all the 
config/routes in Spring.  My example route is:

route

 fromftp://rider.com/orders?username=riderpassword=secret;/from
filter
simple${bean:xmlFilter?method=match}/simple
to uri=log:worked/
/filter
/route

How can I use XPath to pass the user to xmlFilter.match() in the below?

   simple${bean:xmlFilter?method=match}/simple

Thanks
-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Wednesday, February 01, 2012 9:26 AM
To: users@camel.apache.org
Subject: Re: Passing parameter values to bean methods via spring

Hi

You can use the Camel @Xpath annotation on a 2nd parameter in that
method signature

 public boolean match(String username, @XPath(/Example/User) String user) {

You may have to fiddle a bit to get the xpath expression working.
Also sometimes you may have to use /text() to tell it to return the
text content of the xml node.



On Wed, Feb 1, 2012 at 3:05 PM, Gershaw, Geoffrey
geoffrey.gers...@credit-suisse.com wrote:
 Thanks for the reply. Could you give me an example for 1c? I mocked up an 
 example. Assume the below  XML comes from the ftp site. The XMLFilter's match 
 method accepts the username. How can I use XPath to pass the user to the 
 match method?


  Example

                Userjoe/User

  /Example

 Class XMLFilter{

        public boolean match(String username){
                //check db for user
                //if found return true/else false
        }
 }

        route
                
 fromftp://rider.com/orders?username=riderpassword=secret;/from
                filter
                        simple${bean:xmlFilter?method=match}/simple
                        to uri=log:worked/
                /filter
        /route

 Thanks

 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Wednesday, February 01, 2012 3:20 AM
 To: users@camel.apache.org
 Subject: Re: Passing parameter values to bean methods via spring

 Hi

 On Tue, Jan 31, 2012 at 5:10 PM, Gershaw, Geoffrey
 geoffrey.gers...@credit-suisse.com wrote:
 Hello,



 I am a newbie to Camel. I've read a bunch of docs, but have not found an
 answer to this specific use case.


 Welcome to the community.



 1.       Assume the following.

 a.       I have the belown XML msg in the body of my Message.

 Example

                Userjoe/User

 /Example

 b.      I am using a bean as a Filter. The method signature is

                                                               i.
 public boolean validateUser(String user)

 c.       Ideally I would like to user xpath in the config file to pass
 Joe to the validateUser method


 Yes xpath works fine for grabbing content from a XML doc.
 However  where it get tricky is if your XML uses namespaces. If so
 your XPath expression *must* also use namespaces.


 d.      If the method returns false, I would like the route to stop.
 Don't know how to do this.


 You can use a Content Based Router, and in the otherwise leg, you can
 use the stop DSL.


 e.      If the method returns true, I would like to pass the original
 XML msg to a processor and finish the route.


 Yes this happens already, the filter predicate is just for determine
 true | false

 f.        Is this possible?



 Yes, something a like

 from X
  choice
     when bean (myFilterBean)
       to Y
    otherwise
      stop






 Thanks

 Geoff Gershaw


 ===
 Please access the attached hyperlink for an important electronic 
 communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
 ===




 --
 Claus Ibsen
 -
 FuseSource
 Email: cib...@fusesource.com
 Web: http://fusesource.com
 Twitter: davsclaus, fusenews
 Blog: http://davsclaus.blogspot.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
 ===




-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.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 
=== 



Passing parameter values to bean methods via spring

2012-01-31 Thread Gershaw, Geoffrey
Hello,

 

I am a newbie to Camel. I've read a bunch of docs, but have not found an
answer to this specific use case.

 

1.   Assume the following. 

a.   I have the belown XML msg in the body of my Message.

Example

Userjoe/User

/Example

b.  I am using a bean as a Filter. The method signature is 

   i.
public boolean validateUser(String user)

c.   Ideally I would like to user xpath in the config file to pass
Joe to the validateUser method

d.  If the method returns false, I would like the route to stop.
Don't know how to do this.

e.  If the method returns true, I would like to pass the original
XML msg to a processor and finish the route.

f.Is this possible?

 

 

Thanks

Geoff Gershaw


=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
===