You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bing Lu <mf...@yahoo.com.INVALID> on 2020/05/27 02:31:25 UTC

reactive java question

 I have to incorporate a third party api in order to use the reactive functionality of the api. I'm using spring boot with this third party jar, and the starting point is the onNext() method that get invoked whenever an event occurs. My question is how do I make the onNext() method as a starting point of my route, right now I have to build an exchange inside the onNext() method and calling methods from there instead of the normal from(...).to(...) route building functionality. How do I make the onnext() method as a starting point like from(...)?
thanks  

RE: reactive java question

Posted by Micael Kirouac <Mi...@telus.com>.
Did you take a look at camel reactive streams? https://camel.apache.org/components/latest/reactive-streams-component.html

I never tried it personally but it should support what you need to do, see the sections 'sending data to camel' and 'sending data to camel using direct api' more specifically. 

-----Original Message-----
From: Mark Nuttall [mailto:mknuttall@gmail.com] 
Sent: Wednesday, May 27, 2020 7:48 PM
To: users@camel.apache.org
Subject: Re: reactive java question

Without seeing the actual code I can't say for sure but I would use producer template do you send a message to a direct route and have that direct route to be in the from to start the processing in the route

On Tue, May 26, 2020, 10:31 PM Bing Lu <mf...@yahoo.com.invalid> wrote:

>  I have to incorporate a third party api in order to use the reactive 
> functionality of the api. I'm using spring boot with this third party 
> jar, and the starting point is the onNext() method that get invoked 
> whenever an event occurs. My question is how do I make the onNext() 
> method as a starting point of my route, right now I have to build an 
> exchange inside the onNext() method and calling methods from there 
> instead of the normal
> from(...).to(...) route building functionality. How do I make the 
> onnext() method as a starting point like from(...)?
> thanks

Re: reactive java question

Posted by Bing Lu <mf...@yahoo.com.INVALID>.
 I figured it out, I can just use @produce and pump the result of the bean method to the endpoint, and once the bean method(onNext) is invoked, it will start flowing in camel. Silly me.
    On Wednesday, May 27, 2020, 08:00:41 PM EDT, Bing Lu <mf...@yahoo.com.invalid> wrote:  
 
  Our code is subscriber only that consumes event from onNext() which is the starting point of the flow. We're forced to use their api which implements the onNext() function
    On Wednesday, May 27, 2020, 07:48:08 PM EDT, Mark Nuttall <mk...@gmail.com> wrote:  
 
 Without seeing the actual code I can't say for sure but I would use
producer template do you send a message to a direct route and have that
direct route to be in the from to start the processing in the route

On Tue, May 26, 2020, 10:31 PM Bing Lu <mf...@yahoo.com.invalid> wrote:

>  I have to incorporate a third party api in order to use the reactive
> functionality of the api. I'm using spring boot with this third party jar,
> and the starting point is the onNext() method that get invoked whenever an
> event occurs. My question is how do I make the onNext() method as a
> starting point of my route, right now I have to build an exchange inside
> the onNext() method and calling methods from there instead of the normal
> from(...).to(...) route building functionality. How do I make the onnext()
> method as a starting point like from(...)?
> thanks
    

Re: reactive java question

Posted by Bing Lu <mf...@yahoo.com.INVALID>.
 Our code is subscriber only that consumes event from onNext() which is the starting point of the flow. We're forced to use their api which implements the onNext() function
    On Wednesday, May 27, 2020, 07:48:08 PM EDT, Mark Nuttall <mk...@gmail.com> wrote:  
 
 Without seeing the actual code I can't say for sure but I would use
producer template do you send a message to a direct route and have that
direct route to be in the from to start the processing in the route

On Tue, May 26, 2020, 10:31 PM Bing Lu <mf...@yahoo.com.invalid> wrote:

>  I have to incorporate a third party api in order to use the reactive
> functionality of the api. I'm using spring boot with this third party jar,
> and the starting point is the onNext() method that get invoked whenever an
> event occurs. My question is how do I make the onNext() method as a
> starting point of my route, right now I have to build an exchange inside
> the onNext() method and calling methods from there instead of the normal
> from(...).to(...) route building functionality. How do I make the onnext()
> method as a starting point like from(...)?
> thanks
  

Re: reactive java question

Posted by Mark Nuttall <mk...@gmail.com>.
Without seeing the actual code I can't say for sure but I would use
producer template do you send a message to a direct route and have that
direct route to be in the from to start the processing in the route

On Tue, May 26, 2020, 10:31 PM Bing Lu <mf...@yahoo.com.invalid> wrote:

>  I have to incorporate a third party api in order to use the reactive
> functionality of the api. I'm using spring boot with this third party jar,
> and the starting point is the onNext() method that get invoked whenever an
> event occurs. My question is how do I make the onNext() method as a
> starting point of my route, right now I have to build an exchange inside
> the onNext() method and calling methods from there instead of the normal
> from(...).to(...) route building functionality. How do I make the onnext()
> method as a starting point like from(...)?
> thanks