Re: Using Apache Camel Asynchronously

2009-02-23 Thread Ashwin Karpe

Hi,

I am not sure I understand the question. 

A Camel route is made up of 2 or more endpoints which in its most basic form
looks like this,
from(URI in Message Consumer Role).
to(URI in Message Producer role)

The Consumer URI could be a web service, an http listener or a JMS Queue
listener. On the other hand the Producer URI could be a web service client
or http client or a JMS Queue producer.

Obviously if the consumer URI needs to be a web service, you would use the
CXF component which would then require you to provide either WSDL or
annotated code.
 
Hope this clarifies things.

Cheers,

Ashwin...


AnuragS wrote:
 
 Thanks Ashwin,
 
 I'm not anticipating the solution will require to work on different
 technology stacks as the Producer and Consumer are internal to the
 System. 
 However, I may have to expose the consume side of the functionality as a
 Web Service later. Do you think I'll be able to leverage anything from
 Camel if that's the case in future.
 
 -Anurag
 
 
 
 Ashwin Karpe wrote:
 
 Hi,
 
 Camel is primarily a router surrounded by other capabilities (processors,
 interceptors etc). Camel mediates between 2 or more technology endpoints
 and applies rules, transforms, integration patterns along the way.
 
 Asynchronous behavior primarily involves setting up listeners backed by
 an eventing framework. Camel offers this core capability and supports it
 over several protocols, transports.
 
 If your solution is an all JMS solution (i.e a single protocol centric
 asynchronous application) a MOM would do the job just fine. However you
 would need to write the plumbing code yourself and embed it in your
 application.
 
 If however your solution needs to do this over several protocols,
 transports and technology stacks in a simple manner using DSL or Spring
 DSL (with no need to worry about the plumbing code) then Camel is a good
 choice.
 
 Cheers,
 
 Ashwin... 
 
 
 AnuragS wrote:
 
 Does it make sense to use Apache Camel for making asynchronous calls? Or
 the old fashioned MoM is good enough.
 
 
 
 
 


-
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://www.nabble.com/Using-Apache-Camel-Asynchronously-tp22111353p22167997.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



Re: CXF endpoint - No service was found issue

2009-02-23 Thread Sriram C

I got this working by changing  address to /account


Sriram C wrote:
 
 I am trying to create a CXF endpoint using Spring DSL. My endpoint and
 route definitions are as follow:
 
 cxf:cxfEndpoint id=serviceEndpoint
 address=http://localhost:8080/SFServices/services/account;
   wsdlURL=classpath:accountOutboundMessage.wsdl
   serviceClass=com.mypackage.service.NotificationPort
   endpointName=s:Notification
   serviceName=s:NotificationService
   xmlns:s=http://soap.sforce.com/2005/09/outbound; /
 
camelContext id=camel
 xmlns=http://activemq.apache.org/camel/schema/spring;
 route
   from uri=cxf:bean:serviceEndpoint /
   bean ref=testBean method=toCompany/
 /route
/camelContext


 The webapp starts up correctly. I can go to the CXF Service list page and
 see that the service has been correctly initialized. However when I access
 the WSDL for the published service, I see a 'No service was found' message
 with the following warning.  
 
 WARN [13:08:47,515] -
 org.apache.cxf.transport.servlet.ServletController.invoke(126) | Can't
 find the request for http://localhost:8080/SFServices/services/account's
 Observer 
 
 Can somebody point me to what is wrong in my configuration or how I can go
 about debugging this issue?
 
 Thanks
 Sriram
 
 The debug messages from Tomcat startup where the CXF endpoint is setup is
 listed below.
 
 INFO [13:08:33,218] -
 org.apache.cxf.endpoint.ServerImpl.initDestination(91) | Setting the
 server's publish address to be
 http://localhost:8080/SFServices/services/account
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(72)
 | building handler chain
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.findHandlerChainAnnotation(257)
 | Checking for HandlerChain annotation on
 com.mypackage.service.NotificationPort
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(77)
 | no HandlerChain annotation on interface
 com.mypackage.service.NotificationPort
 DEBUG [13:08:33,250] -
 org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247)
 | Registered MBean with objectname:
 org.apache.camel:context=CM-Latitude-E55/camel,type=consumers,name=CxfConsumer(0x91cceb)
 DEBUG [13:08:33,250] -
 org.apache.cxf.transport.AbstractObservable.setMessageObserver(45) |
 registering incoming observer:
 org.apache.cxf.transport.chaininitiationobser...@1bc6271
 DEBUG [13:08:33,250] - org.apache.cxf.endpoint.ServerImpl.start(127) |
 register the server to serverRegistry 
 DEBUG [13:08:33,250] -
 org.apache.camel.impl.DefaultComponent.createEndpoint(79) | Creating
 endpoint uri=[spring-event:default], path=[default], parameters=[{}]
 DEBUG [13:08:33,265] -
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(333) |
 spring-event:default converted to endpoint: Endpoint[spring-event:default]
 by component: org.apache.camel.component.event.eventcompon...@17f61bb
 DEBUG [13:08:33,281] -
 org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247)
 | Registered MBean with objectname:
 org.apache.camel:context=CM-Latitude-E55/camel,type=endpoints,name=spring-event:default\?id=0x20a20c46
 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log
 INFO: Set web app root system property: 'webapp.root' =
 [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\]
 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log
 INFO: Initializing log4j from
 [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\WEB-INF\classes\log4j.xml]
 INFO [13:08:33,453] -
 org.apache.cxf.transport.servlet.CXFServlet.updateContext(120) | Load the
 bus with application context
 INFO [13:08:33,453] -
 org.springframework.context.support.AbstractApplicationContext.prepareRefresh(411)
 | Refreshing org.apache.cxf.bus.spring.busapplicationcont...@1026e12:
 display name [org.apache.cxf.bus.spring.busapplicationcont...@1026e12];
 startup date [Fri Feb 20 13:08:33 PST 2009]; parent:
 org.springframework.web.context.support.xmlwebapplicationcont...@ad5fab
 INFO [13:08:33,468] - org.apache.cxf.common.logging.LogUtils.doLog(345) |
 No cxf.xml configuration file detected, relying on defaults.
 DEBUG [13:08:33,468] -
 org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources(179) |
 Creating application context with resources: []
 INFO [13:08:33,468] -
 org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(426)
 | Bean factory for application context
 [org.apache.cxf.bus.spring.busapplicationcont...@1026e12]:
 org.springframework.beans.factory.support.defaultlistablebeanfact...@cebf1c
 DEBUG [13:08:33,468] -
 org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(430)
 | 0 beans defined in
 

Restlet Component Fault Handling

2009-02-23 Thread tfredrich

I'm utilizing the Restlet component (via a Trunk build) and am interested in
better understanding error handling behavior via the exchange fault message. 
BTW, I appreciate your work on this component!  Good stuff, indeed.

In essence, I'm simply using camel-restlet to expose a JSON RESTful service
with CRUD behavior.  The route looks something like this:

from(restlet:http://localhost:8080/people/person/{userId}?restletMethod=GET;)
.intercept(new AuthenticationInterceptor())
.process(new QueryStringProcessor())
.process(new GetPersonProcessor())
.marshal(format)
.process(new JsonpProcessor());

Of interest for my question is the GetPersonProcessor, which is responsible
for retrieving the person object from a storage repository.  When a
non-existent userId is requested, the GetPersonProcessor does not return a
person object and, instead sets the restlet response header to 404 (not
found).  After reading the Camel manual, I thought it best to set the 404
along with a fault message on the exchange, but the restlet component
doesn't appear to acknowledge the fault and composes its response from the
out message.  So, unless I misunderstand, I have to set the 404 on the out
message header (for the restlet component) and set the body on the fault
message (for camel to terminate the pipeline).

Now for the question:  Is this the way I should be doing things?  Or
could/should the DefaultRestletBinding utilize the fault message to compose
its response, if a fault message exists?  Your feedback is much appreciated.

Thanks,
--Todd
-- 
View this message in context: 
http://www.nabble.com/Restlet-Component-Fault-Handling-tp22173327p22173327.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



Re: CXF endpoint - No service was found issue

2009-02-23 Thread Willem Jiang
It looks like the mail send to users@camel.apache.org still doesn't be
shown in the nabble.
---BeginMessage---
Hi ,

If you are using the ServletTransport for the CXF endpoint, you need to
use the related path instead of full path for the address.
Here[1] is the explanation for it

For you case , please change the cxf endpoint's address to /account.

[1] http://cwiki.apache.org/CXF20DOC/servlet-transport.html

Willem

Sriram C wrote:
 I am trying to create a CXF endpoint using Spring DSL. My endpoint and route
 definitions are as follow:
 
 cxf:cxfEndpoint id=serviceEndpoint
 address=http://localhost:8080/SFServices/services/account;
   wsdlURL=classpath:accountOutboundMessage.wsdl
   serviceClass=com.mypackage.service.NotificationPort
   endpointName=s:Notification
   serviceName=s:NotificationService
   xmlns:s=http://soap.sforce.com/2005/09/outbound; /
 
camelContext id=camel
 xmlns=http://activemq.apache.org/camel/schema/spring;
 route
   from uri=cxf:bean:serviceEndpoint /
   bean ref=testBean method=toCompany/
 /route
/camelContext


 The webapp starts up correctly. I can go to the CXF Service list page and
 see that the service has been correctly initialized. However when I access
 the WSDL for the published service, I see a 'No service was found' message
 with the following warning.  
 
 WARN [13:08:47,515] -
 org.apache.cxf.transport.servlet.ServletController.invoke(126) | Can't find
 the request for http://localhost:8080/SFServices/services/account's Observer 
 
 Can somebody point me to what is wrong in my configuration or how I can go
 about debugging this issue?
 
 Thanks
 Sriram
 
 The debug messages from Tomcat startup where the CXF endpoint is setup is
 listed below.
 
 INFO [13:08:33,218] - org.apache.cxf.endpoint.ServerImpl.initDestination(91)
 | Setting the server's publish address to be
 http://localhost:8080/SFServices/services/account
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(72)
 | building handler chain
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.findHandlerChainAnnotation(257)
 | Checking for HandlerChain annotation on
 com.mypackage.service.NotificationPort
 DEBUG [13:08:33,250] -
 org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(77)
 | no HandlerChain annotation on interface
 com.mypackage.service.NotificationPort
 DEBUG [13:08:33,250] -
 org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247)
 | Registered MBean with objectname:
 org.apache.camel:context=CM-Latitude-E55/camel,type=consumers,name=CxfConsumer(0x91cceb)
 DEBUG [13:08:33,250] -
 org.apache.cxf.transport.AbstractObservable.setMessageObserver(45) |
 registering incoming observer:
 org.apache.cxf.transport.chaininitiationobser...@1bc6271
 DEBUG [13:08:33,250] - org.apache.cxf.endpoint.ServerImpl.start(127) |
 register the server to serverRegistry 
 DEBUG [13:08:33,250] -
 org.apache.camel.impl.DefaultComponent.createEndpoint(79) | Creating
 endpoint uri=[spring-event:default], path=[default], parameters=[{}]
 DEBUG [13:08:33,265] -
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(333) |
 spring-event:default converted to endpoint: Endpoint[spring-event:default]
 by component: org.apache.camel.component.event.eventcompon...@17f61bb
 DEBUG [13:08:33,281] -
 org.apache.camel.management.DefaultInstrumentationAgent.registerMBeanWithServer(247)
 | Registered MBean with objectname:
 org.apache.camel:context=CM-Latitude-E55/camel,type=endpoints,name=spring-event:default\?id=0x20a20c46
 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log
 INFO: Set web app root system property: 'webapp.root' =
 [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\]
 Feb 20, 2009 1:08:33 PM org.apache.catalina.core.ApplicationContext log
 INFO: Initializing log4j from
 [C:\projects\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SFServices\WEB-INF\classes\log4j.xml]
 INFO [13:08:33,453] -
 org.apache.cxf.transport.servlet.CXFServlet.updateContext(120) | Load the
 bus with application context
 INFO [13:08:33,453] -
 org.springframework.context.support.AbstractApplicationContext.prepareRefresh(411)
 | Refreshing org.apache.cxf.bus.spring.busapplicationcont...@1026e12:
 display name [org.apache.cxf.bus.spring.busapplicationcont...@1026e12];
 startup date [Fri Feb 20 13:08:33 PST 2009]; parent:
 org.springframework.web.context.support.xmlwebapplicationcont...@ad5fab
 INFO [13:08:33,468] - org.apache.cxf.common.logging.LogUtils.doLog(345) | No
 cxf.xml configuration file detected, relying on defaults.
 DEBUG [13:08:33,468] -
 org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources(179) |
 Creating application context with resources: []
 INFO [13:08:33,468] -
 

Is Mina custom codec overriding text line codec

2009-02-23 Thread huntc

Hi there,

I think I may have found a problem:

mina:tcp://0.0.0.0:8201?textline=truetextlineDelimiter=WINDOWSsync=falseminaLogger=true

If I use the above while having already registered some other Mina endpoints
that have their own codec, I think that the text line options become
confused.

In fact if I set a breakpoint in a previously registered codec then I find
that the codec's decoder is invoked when I send stuff to port 8201...

I've ran out of time to experiment further with this today. Meanwhile if
there are any thoughts on this potential issue then please feel free to air
them. %-|

Kind regards,
Christopher
-- 
View this message in context: 
http://www.nabble.com/Is-Mina-custom-codec-overriding-text-line-codec-tp22176938p22176938.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



Re: How to close Mina session ?

2009-02-23 Thread Nicolas Bouillon
Hello,

I've checkouted last friday the lastest SVN version of 1.6 branch, and
compiled camel-core and camel-mina (i don't success compiling whole camel
parts), and installed to my local maven repository.

The patch works fine. I will try to work with 1.6.1-SNAPSHOT from the
official camel site. I will report if something goes wrong.

Thanks
Nicolas.

On Fri, Feb 20, 2009 at 18:28, Claus Ibsen claus.ib...@gmail.com wrote:

 On Fri, Feb 20, 2009 at 5:12 PM, Nicolas Bouillon nico...@bouil.org
 wrote:
  Thank you very much for the patch, and for the velocity !
 You are welcome.

 Thanks for reporting.

 If you can test it that would be great.
 See download page how to use 1.6.1-SNAPSHOT version. eg = Apache
 SNAPSHOT maven repo and all that stuff.

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





Re: How to close Mina session ?

2009-02-23 Thread Claus Ibsen
On Tue, Feb 24, 2009 at 8:12 AM, Nicolas Bouillon nico...@bouil.org wrote:
 Hello,

 I've checkouted last friday the lastest SVN version of 1.6 branch, and
 compiled camel-core and camel-mina (i don't success compiling whole camel
 parts), and installed to my local maven repository.

 The patch works fine. I will try to work with 1.6.1-SNAPSHOT from the
 official camel site. I will report if something goes wrong.
Hi

Thanks for the report. Glad the patch seems to work.


 Thanks
 Nicolas.

 On Fri, Feb 20, 2009 at 18:28, Claus Ibsen claus.ib...@gmail.com wrote:

 On Fri, Feb 20, 2009 at 5:12 PM, Nicolas Bouillon nico...@bouil.org
 wrote:
  Thank you very much for the patch, and for the velocity !
 You are welcome.

 Thanks for reporting.

 If you can test it that would be great.
 See download page how to use 1.6.1-SNAPSHOT version. eg = Apache
 SNAPSHOT maven repo and all that stuff.

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







-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


Re: Is Mina custom codec overriding text line codec

2009-02-23 Thread Claus Ibsen
Hi

Yeah there could be a problem as it looks like the mina component holds state.

camel-mina has been refactored in 2.0 to be consistent with best
practice for components in Camel and should not have this flaw.

As a workaround could you try defining a new mina component, eg mina2
that differs from the others.

bean id=mina2 class=org.apache.camel.component.mina.MinaComponent/

And then use mina2 as scheme.

In Java there is a API on CamelContext to add a component if you are
not using spring.

Could you try this workaround, then we are sure what the problem is
and know how to fix it for the next release.



On Tue, Feb 24, 2009 at 8:07 AM, huntc hu...@mac.com wrote:

 Hi there,

 I think I may have found a problem:

 mina:tcp://0.0.0.0:8201?textline=truetextlineDelimiter=WINDOWSsync=falseminaLogger=true

 If I use the above while having already registered some other Mina endpoints
 that have their own codec, I think that the text line options become
 confused.

 In fact if I set a breakpoint in a previously registered codec then I find
 that the codec's decoder is invoked when I send stuff to port 8201...

 I've ran out of time to experiment further with this today. Meanwhile if
 there are any thoughts on this potential issue then please feel free to air
 them. %-|

 Kind regards,
 Christopher
 --
 View this message in context: 
 http://www.nabble.com/Is-Mina-custom-codec-overriding-text-line-codec-tp22176938p22176938.html
 Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/