Re: simple example for JDBC in osgi

2011-10-18 Thread Claus Ibsen
On Tue, Oct 18, 2011 at 8:03 AM, Filippo Balicchia  wrote:
> Hello,
> I try to find a simple jdbc example that run under osgi environment.
> While browsing jira i found the following issue CAMEL-3096, but on repository
> I' don't find nothing.
>
>
> Could you, please suggest me a link where i can i found a simple
> example that show how save data in osgi environment with
> jdbc.
>

Hi we have some unit tests for osgi in the source code

There is example of JPA, iBatis and others AFAIR
https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest-osgi/

Also Charles Moulliard is giving a 2-part series webinar this and next
month on using JDBC and TX with Camel and OSGi
http://fusesource.com/resources/video-archived-webinars/


> Cheers
>
> --Filippo
>



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


Re: How to setup a dynamic route using beans in Java w/o having a spring ref to them?

2011-10-18 Thread klausb
Hi Jesus,

it's not a burning issue any longer (for me), but I'm still curious.
So if you could sketch your solution, that would be helpful. I can imagine,
picking up this approach again in future projects.

Regards,
klaus.

--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-setup-a-dynamic-route-using-beans-in-Java-w-o-having-a-spring-ref-to-them-tp3304398p4912687.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Multiple camelContext in Spring XML with single properties reference

2011-10-18 Thread mhawkshaw
Hi,

I'm using Camel 2.7.2, and I have a Spring XML file with multiple Camel
Contexts defined. To expose the properties defined in an external file to
the camel contexts, we have the following lines in the XML:






We can then use the syntax {{my.property}} in multiple camelContext
definitions in the same file, for example in from:



However when using Simple, the use of {{ }} for properties does not work, we
must use ${properties:my.property}:

${properties:my.property} == 'true'

We must also add the following line to load the properties again for this
camelContext:



Otherwise it does not work as it doesn't seem to use the bean "properties"
defined elsewhere outside of the camelContext.

My question is, is there a better way of doing this? At the moment, I have
to add a reference to my properties file three times: once for Spring, once
for Camel and once again in the camelContext using camel:simple.

Thanks for any tips!

--
View this message in context: 
http://camel.465427.n5.nabble.com/Multiple-camelContext-in-Spring-XML-with-single-properties-reference-tp4912793p4912793.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: simple example for JDBC in osgi

2011-10-18 Thread Ioannis Canellos
You might also want to have a look that the following patch (its not
committed yet) which uses camel-sql with both spring and blueprint routes.

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


-- 
*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache ServiceMix   Committer
Apache Gora  Committer
*


Re: Hazelcast Component persistence

2011-10-18 Thread Ioannis Canellos
There is a pending patch for commit, which would allow the hazelcast
component to be passed an existing Hazelcast instance. Once this is
committed you will be able to configure Hazelcast with any way you want and
just pass it to the component.
-- 
*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache ServiceMix   Committer
Apache Gora  Committer
*


problem with Timer based polling consumer

2011-10-18 Thread matsumoto
Hi 
I have a problem with Timer based polling consumer
I want consume all messages from a JMS queue, process the message and send
them to the next queue
but I don't know how to do this and on
http://camel.apache.org/polling-consumer.html is Error formatting macro:
snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

has anybody know how do this case ?

Arek




--
View this message in context: 
http://camel.465427.n5.nabble.com/problem-with-Timer-based-polling-consumer-tp4913140p4913140.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple camelContext in Spring XML with single properties reference

2011-10-18 Thread Willem Jiang

properties components is used per camel context.
I'm afraid you have to define it inside of the camel context if you have 
multiple camelContext to use.


On Tue Oct 18 15:47:26 2011, mhawkshaw wrote:

Hi,

I'm using Camel 2.7.2, and I have a Spring XML file with multiple Camel
Contexts defined. To expose the properties defined in an external file to
the camel contexts, we have the following lines in the XML:



 


We can then use the syntax {{my.property}} in multiple camelContext
definitions in the same file, for example in from:



However when using Simple, the use of {{ }} for properties does not work, we
must use ${properties:my.property}:

${properties:my.property} == 'true'

We must also add the following line to load the properties again for this
camelContext:



Otherwise it does not work as it doesn't seem to use the bean "properties"
defined elsewhere outside of the camelContext.

My question is, is there a better way of doing this? At the moment, I have
to add a reference to my properties file three times: once for Spring, once
for Camel and once again in the camelContext using camel:simple.

Thanks for any tips!

--
View this message in context: 
http://camel.465427.n5.nabble.com/Multiple-camelContext-in-Spring-XML-with-single-properties-reference-tp4912793p4912793.html
Sent from the Camel - Users mailing list archive at Nabble.com.




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


Re: problem with Timer based polling consumer

2011-10-18 Thread Claus Ibsen
On Tue, Oct 18, 2011 at 12:10 PM, matsumoto  wrote:
> Hi
> I have a problem with Timer based polling consumer
> I want consume all messages from a JMS queue, process the message and send
> them to the next queue
> but I don't know how to do this and on
> http://camel.apache.org/polling-consumer.html is Error formatting macro:
> snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20
>

Must you use a polling consumer?

Instead you can use an event driven consumer and have a simpler Camel route

from JMS
   process Message
   to JMS



> has anybody know how do this case ?
>
> Arek
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/problem-with-Timer-based-polling-consumer-tp4913140p4913140.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: simple example for JDBC in osgi

2011-10-18 Thread Claus Ibsen
On Tue, Oct 18, 2011 at 11:23 AM, Ioannis Canellos  wrote:
> You might also want to have a look that the following patch (its not
> committed yet) which uses camel-sql with both spring and blueprint routes.
>
> https://issues.apache.org/jira/browse/CAMEL-4465
>

I have committed the patch to trunk. Thanks for the patch. We can
always use more OSGi unit tests.


>
> --
> *Ioannis Canellos*
> *
> FuseSource 
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Apache Karaf  Committer & PMC
> Apache ServiceMix   Committer
> Apache Gora  Committer
> *
>



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


Re: problem with Timer based polling consumer

2011-10-18 Thread matsumoto
no, becouse I want do this with timer 
somethilng like that

timer?perioid=6000 . process(check condition) if condition is true do  from
activemq:queue with size to activemq:queue

--
View this message in context: 
http://camel.465427.n5.nabble.com/problem-with-Timer-based-polling-consumer-tp4913140p4913344.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: problem with Timer based polling consumer

2011-10-18 Thread Claus Ibsen
On Tue, Oct 18, 2011 at 1:29 PM, matsumoto  wrote:
> no, becouse I want do this with timer
> somethilng like that
>
> timer?perioid=6000 . process(check condition) if condition is true do  from
> activemq:queue with size to activemq:queue
>

I have fixed the wiki page. Will get updated later.

You can check the source code here
https://svn.apache.org/repos/asf/camel/tags/camel-2.6.0/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTimerBasedPollingConsumerTest.java

> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/problem-with-Timer-based-polling-consumer-tp4913140p4913344.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Missing "detail" element in SOAP fault

2011-10-18 Thread sengel
Hello,

we have a system consisting of (web and other) clients and our backend (SOAP
web services). Now when we throw a Fault/Exception in a backend operation,
the SOAP fault looks like this:

http://schemas.xmlsoap.org/soap/envelope/";>
   
   
  
 env:Server
 An entity with the same ID already
exists
 
http://www.example.com/example/";>
   Entity was not created. An entity with the same ID
already exists

 
  
   


The client side uses the subelement "duplicateEntityFault" of "detail" to
generate the Exception class which we expect and catch
(DuplicateEntityFault_Exception).

So now we added Camel to the setup which routes requests to the backend. We
expected that if a Fault/Exception is thrown on the backend, Camel would
just pass it back to the client. But, no. Instead the client gets this:

http://schemas.xmlsoap.org/soap/envelope/";>
   
  
 soap:Server
 HTTP operation failed invoking
http://www.example.com/example/example-service with statusCode:
500
  
   


So the problem is that there is no "detail" element in the fault message
from which the client can generate the Exception. Camel logs this:
Exhausted after delivery attempt: 1 caught:
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation
failed invoking http://www.example.com/example/example-service with
statusCode: 500

Could you please tell us what is missing or what we do wrong?
Thanks in advance,

Sebastian

--
View this message in context: 
http://camel.465427.n5.nabble.com/Missing-detail-element-in-SOAP-fault-tp4913512p4913512.html
Sent from the Camel - Users mailing list archive at Nabble.com.


how to call route from other route?

2011-10-18 Thread Trop
Hello,
I have route:

ftp://anonymous@localhost/"; />




and i want call from 


etc.

Regards 
trp

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-route-from-other-route-tp4913610p4913610.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to call route from other route?

2011-10-18 Thread Ioannis Canellos
Can you please provide some more details on what you want to do?

Typically, routes communicate with each other when they share endpoints. For
example:


  
  






But I am not sure if this is what you want.

*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache ServiceMix   Committer
Apache Gora  Committer
*


Directory synchronization with Camel

2011-10-18 Thread Radomir Kadlec
Hello,
I have to use Camel (and Servicemix) for *remote directory synchronization*.
Files shall be transfered from the source directory structure to the
destination place over Internet.
I supposed the best way to implement this case is to use Camel *file* and
*ftp* components.

But I can not find any way to implement this functionality, because the old
files must stay in their directories.
They may not be deleted or moved and every file shall be transfered only
once.

The nearest way i found is to use the *indempotent repository* to memory all
transfered files.
But this repository contains *filenames only*. When the old file is replaced
with new one with the same filename, the Camel file consumer doesn't choose
it for transport any more.
I miss the *file date in the key* in this indempotent repository.

Or is there another way to synchronize two remote directories using Camel?

Thanks for any tips.
Radomir 

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


Re: jid-malformed error in XMPP component

2011-10-18 Thread Jeff Segal
Just to add to this, I receive the same error when pointing at a local
instance of Openfire rather than jabber.org.

On Mon, Oct 17, 2011 at 8:17 AM, Jeff Segal  wrote:

> Hi Claus,
>
> I'm  using 2.8.1.
>
> Jeff
>
>
> On Mon, Oct 17, 2011 at 8:09 AM, Claus Ibsen wrote:
>
>> Hi
>>
>> What version of Camel are you using?
>>
>> On Fri, Oct 14, 2011 at 8:42 PM, Jeff Segal 
>> wrote:
>> > I'm testing the XMPP component against the public jabber.org servers
>> > and seeing an unexpected problem when sending messages to a MUC. I
>> > have both a consumer and producer route and the consumer can receive
>> > messages sent from an external client successfully. I'd like the same
>> > user to be able to send and receive messages, so the two endpoints are
>> > the same:
>> >
>> > Consumer: xmpp://
>> jse...@jabber.org:5222?password=&room=o2e%40conference.jabber.org&serviceName=jabber.org
>> > Producer: xmpp://
>> jse...@jabber.org:5222?password=&room=o2e%40conference.jabber.org&serviceName=jabber.org
>> >
>> > Here's a truncated version of the DEBUG logging when I add both routes
>> > and attempt to send a message to the producer. Note that it's all
>> > "normal" until the jid-malformed error.
>> >
>> > DEBUG org.apache.camel.component.xmpp.XmppLogger  - INBOUND :
>> > > > from="o...@conference.jabber.org/o2e-user">1> > xmlns="http://jabber.org/protocol/caps";>> > xmlns="http://jabber.org/protocol/muc#user";>> > role="participant">> > jid=""/>
>> > INFO  org.apache.camel.component.xmpp.XmppGroupChatProducer  - Joined
>> > room: o...@conference.jabber.org as: jsegal
>> > DEBUG org.apache.camel.component.xmpp.XmppLogger  - INBOUND :
>> > > > from="o...@conference.jabber.org/jsegal">> > xmlns="http://jabber.org/protocol/muc#user";>> > role="moderator">> > code="110"/>
>> > DEBUG org.apache.camel.component.xmpp.XmppGroupChatProducer  -
>> > Starting producer:
>> > Producer[xmpp://
>> jse...@jabber.org:5222?password=P%40%24%24w0rd&room=o2e%40conference.jabber.org&serviceName=jabber.org
>> ]
>> > DEBUG org.apache.camel.component.xmpp.XmppGroupChatProducer  - Sending
>> > XMPP message: my message
>> > DEBUG org.apache.camel.component.xmpp.XmppLogger  - OUTBOUND :
>> > > > type="groupchat">my message
>> > DEBUG org.apache.camel.component.xmpp.XmppLogger  - INBOUND : > > id="sR10F-6" to="jsegal" from="o...@conference.jabber.org"
>> > type="error">7jN470> > type="MODIFY">> > xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
>> >
>> > I have no problem using Pidgin to log into this account, connect to
>> > the same MUC and send messages to it.
>> >
>> > Any thoughts on why I'm seeing this problem?
>> >
>> > Thanks,
>> > Jeff
>> >
>>
>>
>>
>> --
>> 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/
>>
>
>


Re: Directory synchronization with Camel

2011-10-18 Thread Ioannis Canellos
Have you tied the noop=true option on the URI?

-- 
*Ioannis Canellos*
*
FuseSource 

**
Blog: http://iocanel.blogspot.com
**
Apache Karaf  Committer & PMC
Apache ServiceMix   Committer
Apache Gora  Committer
*


Re: how to call route from other route?

2011-10-18 Thread Trop
Hi,
I want to cause a problem downloading files from FTP on different events
such as /quartz:/, /jms:/, /jetty:/.
/direct:/ is not suitable, because
 
ftp://...";> 
 
upload files to ftp.

Sorry for my english. 
Regards 
trp

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-route-from-other-route-tp4913610p4914426.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXFRS and printing out put to XML file

2011-10-18 Thread santoshjoshi
Thanks Everyone in this forum,

I got the solution, basically my camel-context configuration was not up to
that mark,

The below configuration solved my problem.
 

http://REALSERVER.COM/REST/"; createdFromAPI="true"
staticSubresourceResolution="true">







 

http://REALSERVER.COM/REST/"; 
  serviceClass="com.santosh.CityServiceImpl"
  username="santosh" password="pwd" />

 
http://localhost:8123/REST/";
serviceClass="com.santosh.CityService" username="santosh" 
password="pwd">


   
http://localhost:8123/REST/";
serviceClass="com.santosh.CityServiceImpl" />


THE STEPS ARE 
1)  create  JAXRS PROXY CLIENT and get it in your have code
   CityService cityService = (CityService)
context.getBean("cityServiceClient");
   cityService.getCities("INDIA");

2) the above code will call the SERVER (LOCAL) 

3)  the above step  will call  YOUR PROXY CLIENT 

4) the PROXY CLIENT will call the ACTUAL REAL SERVER


Please correct if i am wrong,

Thanks
Santosh

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXFRS-and-printing-out-put-to-XML-file-tp4902503p4914796.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to call route from other route?

2011-10-18 Thread boday
Trop, your example does this already...its just asynchronous because you are
using JMS.  If you want synchronous behavior, then use direct...


Trop wrote:
> 
> Hello,
> I have route:
> 
>   ftp://anonymous@localhost/"; />
>   
>   
> 
> 
> and i want call from 
> 
> 
> etc.
> 
> Regards 
> trp
> 


-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-route-from-other-route-tp4913610p4915492.html
Sent from the Camel - Users mailing list archive at Nabble.com.


can't route from servlet component to http component

2011-10-18 Thread Joe Niski
I'm trying to configure a multicast route that receives an HTTP POST and 
POSTs it to multiple instances of a service.


From reading the documentation, the book, this list, and playing with 
the camel-example-servlet-tomcat, it looks like it should be simple, but 
i'm stuck.


Here's my web.xml for configuring the Camel Servlet:




contextConfigLocation
/WEB-INF/applicationContext.xml



MulticastServlet
org.apache.camel.component.servlet.CamelHttpTransportServlet
1



MulticastServlet
/send/*



org.springframework.web.context.ContextLoaderListener


WEB-INF/index.xhtml



Here's my camel context and route:

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




http://192.168.22.95:8135/transform-service/send/license"/>
http://0.0.0.0:9080/send/license"/>




The service expects data in request parameters. i can post directly to 
both endpoint URIs with an http tool ("Poster" plugin for Firefox) 
successfully.


However, when i post to this webapp (running in Jetty), at the URI 
"http://localhost:8080/send/license"; i get a 404 error. In the Jetty 
debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer 
to service request [POST /send/license]"


I suspect i'm missing something obvious in configuring the URI for the 
Camel servlet.


thanks in advance,
Joe
--

*Joe Niski*
Senior Developer - Information Services | NWEA™

PHONE 503.548.5207 | FAX 503.639.7873

NWEA.ORG  | Partnering to help all kids learn™



Re: can't route from servlet component to http component

2011-10-18 Thread Joe Niski

i should have mentioned that i'm using camel 2.7.1.

*Joe Niski*
Senior Developer - Information Services  |  NWEA™

PHONE 503.548.5207 | FAX 503.639.7873

NWEA.ORG  | Partnering to help all kids learn™


On 10/18/2011 04:18 PM, Joe Niski wrote:

I'm trying to configure a multicast route that receives an HTTP POST and
POSTs it to multiple instances of a service.

  From reading the documentation, the book, this list, and playing with
the camel-example-servlet-tomcat, it looks like it should be simple, but
i'm stuck.

Here's my web.xml for configuring the Camel Servlet:




contextConfigLocation
/WEB-INF/applicationContext.xml



MulticastServlet
org.apache.camel.component.servlet.CamelHttpTransportServlet
1



MulticastServlet
/send/*



org.springframework.web.context.ContextLoaderListener


WEB-INF/index.xhtml



Here's my camel context and route:

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



http://192.168.22.95:8135/transform-service/send/license"/>
http://0.0.0.0:9080/send/license"/>




The service expects data in request parameters. i can post directly to
both endpoint URIs with an http tool ("Poster" plugin for Firefox)
successfully.

However, when i post to this webapp (running in Jetty), at the URI
"http://localhost:8080/send/license"; i get a 404 error. In the Jetty
debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer
to service request [POST /send/license]"

I suspect i'm missing something obvious in configuring the URI for the
Camel servlet.

thanks in advance,
Joe


Re: can't route from servlet component to http component

2011-10-18 Thread Willem Jiang
First you need to cache the stream[1] for posting it across different 
endpoints.
http://0.0.0.0:9080/send/license"/> will create a producer, it 
doesn't listen to the address as you want.


[1]http://camel.apache.org/stream-caching.html

On 10/19/11 7:18 AM, Joe Niski wrote:

I'm trying to configure a multicast route that receives an HTTP POST and
POSTs it to multiple instances of a service.

 From reading the documentation, the book, this list, and playing with
the camel-example-servlet-tomcat, it looks like it should be simple, but
i'm stuck.

Here's my web.xml for configuring the Camel Servlet:




contextConfigLocation
/WEB-INF/applicationContext.xml



MulticastServlet
org.apache.camel.component.servlet.CamelHttpTransportServlet

1



MulticastServlet
/send/*



org.springframework.web.context.ContextLoaderListener



WEB-INF/index.xhtml



Here's my camel context and route:

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



http://192.168.22.95:8135/transform-service/send/license"/>
http://0.0.0.0:9080/send/license"/>




The service expects data in request parameters. i can post directly to
both endpoint URIs with an http tool ("Poster" plugin for Firefox)
successfully.

However, when i post to this webapp (running in Jetty), at the URI
"http://localhost:8080/send/license"; i get a 404 error. In the Jetty
debug log, i see "DEBUG [CamelHttpTransportServlet.service]: No consumer
to service request [POST /send/license]"

I suspect i'm missing something obvious in configuring the URI for the
Camel servlet.

thanks in advance,
Joe



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


Re: how to call route from other route?

2011-10-18 Thread Gnanaguru S

Hi Trop


ftp://anonymous@localhost/"; />




ftp://anonymous@localhost/"; />



You can use two routes. If you want to do it parallel, Then you can specify
each route as a separate bundle.


Regards
Guru

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-route-from-other-route-tp4913610p4916386.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to call route from other route?

2011-10-18 Thread Trop
Hi Gnanaguru 

Likely I am incorrectly expressed. 
I need like this



ftp://anonymous@localhost/"; /> 



Regards
trp

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-route-from-other-route-tp4913610p4916399.html
Sent from the Camel - Users mailing list archive at Nabble.com.