Re: Need to ACK messages before end of route

2021-04-20 Thread David Shubert
Steve

Yes, I broke these up into routes. I tried your idea by making processor4
throw an exception but Pubsub still redelivers the message. Did I put it
into the right place?

Thanks,
David

  rest("myURL")
 .post("lastPartOfURL")
 .outType(String.class)
 .route()
.routeId("invite-candidates-route")
.setExchangePattern(ExchangePattern.InOnly)
.process(processor1)   // business
logic plus create message and save in exchange properties
.wireTap("direct:toProcessor2");


from("direct:toProcessor2")
  .description("Send email data to the email pubsub.")
  .setExchangePattern(ExchangePattern.InOnly) // Is this where you
indicate to put  ExchangePattern.InOnly??
   .process(processor2)// get message
from exchange and convert to binary for Google pubsub
   .to("google-pubsub://MyProjectId:myTopic"));


 from("google-pubsub://MyProjectId:mySubscription")
  .description("Pull the message from the email pubsub.")
  .process(processor3)   // Get message
from pubsub and convert to Object. Put in exchange body
  .to("direct:toProcessor4")
  ;

from("direct:toProcessor4")
  .process(processor4)   // More business
logic.


On Tue, Apr 20, 2021 at 11:26 AM Steve Huston  wrote:

> Is the Process1 -> Processor2 route logically separate from Processor3 ->
> Processor4? If yes, put them in separate routes. Mark the "put on Google
> PubSub" InOnly then it won't wait for a reply.
> -Steve
>
> > -----Original Message-----
> > From: David Shubert 
> > Sent: Tuesday, April 20, 2021 11:20 AM
> > To: users@camel.apache.org
> > Subject: Need to ACK messages before end of route
> >
> > Hello
> >
> > I have Camel routes that look like this:
> >
> > Processor1->Processor2->Processor3->Processor4
> >
> > Processor1 does some business logic.
> > Processor2 puts a message on Google PubSub.
> > Processor3 takes the message from Google PubSub.
> > Processor4 uses info from the message to do things.
> >
> > My problem is that Camel doesn't ACK the message until Processor4
> > successfully completes. So if Processor4 throws an exception the message
> is
> > redelivered endlessly. This is not what I want.
> >
> > Is there a way to tell Camel to ACK the message in Processor3 so that it
> won't
> > be redelivered?
> >
> > Thanks,
> > David
> >
> > --
> > This email message is for the sole use of the intended recipient(s) and
> may
> > contain confidential and privileged information. Any unauthorized review,
> > use, disclosure or distribution is prohibited. If you are not the
> intended
> > recipient, please contact the sender by reply email and destroy all
> copies of
> > the original message.
>

-- 
This email message is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies 
of the original message.


RE: Need to ACK messages before end of route

2021-04-20 Thread Steve Huston
Is the Process1 -> Processor2 route logically separate from Processor3 -> 
Processor4? If yes, put them in separate routes. Mark the "put on Google 
PubSub" InOnly then it won't wait for a reply.
-Steve

> -Original Message-
> From: David Shubert 
> Sent: Tuesday, April 20, 2021 11:20 AM
> To: users@camel.apache.org
> Subject: Need to ACK messages before end of route
> 
> Hello
> 
> I have Camel routes that look like this:
> 
> Processor1->Processor2->Processor3->Processor4
> 
> Processor1 does some business logic.
> Processor2 puts a message on Google PubSub.
> Processor3 takes the message from Google PubSub.
> Processor4 uses info from the message to do things.
> 
> My problem is that Camel doesn't ACK the message until Processor4
> successfully completes. So if Processor4 throws an exception the message is
> redelivered endlessly. This is not what I want.
> 
> Is there a way to tell Camel to ACK the message in Processor3 so that it won't
> be redelivered?
> 
> Thanks,
> David
> 
> --
> This email message is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. Any unauthorized review,
> use, disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies of
> the original message.


Need to ACK messages before end of route

2021-04-20 Thread David Shubert
Hello

I have Camel routes that look like this:

Processor1->Processor2->Processor3->Processor4

Processor1 does some business logic.
Processor2 puts a message on Google PubSub.
Processor3 takes the message from Google PubSub.
Processor4 uses info from the message to do things.

My problem is that Camel doesn't ACK the message until Processor4
successfully completes. So if Processor4 throws an exception the message is
redelivered endlessly. This is not what I want.

Is there a way to tell Camel to ACK the message in Processor3 so that it
won't be redelivered?

Thanks,
David

-- 
This email message is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies 
of the original message.