Hi Jeroen,

Your approach is correct, and it is intended to override routeResponse if
you need different behavior, see the docs.

 /**
   * Called after a response was received from the endpoint specified by
<code>endpointUri</code>. The
   * response is passed as argument. By default, this method sends the
response back to the original sender
   * if <code>oneway</code> is <code>false</code>. If <code>oneway</code>
is <code>true</code>, nothing is
   * done. This method may be overridden by subtraits or subclasses (e.g.
to forward responses to another
   * actor).
   */

It is assumed that when you set oneway to true that you really are not
interested in the result. In your specific case you do need it. See
http://krasserm.blogspot.com.au/2011/02/akka-producer-actor-new-features-and.html
for some history on this feature, it was called receiveAfterProduce at the
time.

On Sat, Nov 8, 2014 at 8:39 AM, Jeroen Gordijn <[email protected]>
wrote:

> Hi all,
>
> I want to place a message on a JMS Queue with Akka-Camel. This works just
> fine, however I want to be sure that the message was really placed on the
> queue. The queue is oneway, so I do not expect any response from another
> consumer. However, when I configure this in my code as oneway, the actor
> sending to the producer does not get any notification that the message was
> really delivered on the queue.
>
> ProducerSupport in Akka-Camel has the following code:
>       protected def routeResponse(msg: Any): Unit = if (!oneway) sender()
> ! transformResponse(msg)
>
> This means that I do not get any response when oneway is configured. But
> the endpoint does give feedback whether the message was delivered and this
> is now lost. I solved it by putting the following code in my own producer:
>
>       override protected def routeResponse(msg: Any): Unit = sender() !
> transformResponse(msg)
>
> Is there any reason for the if statement? Can anything go wrong when the
> if statement is dropped in the akka-camel codebase?
>
> Thanks,
> Jeroen
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Raymond Roestenburg

code: http://github.com/RayRoestenburg
blog: http://roestenburg.agilesquad.com
twtr: @RayRoestenburg
book: http://manning.com/roestenburg

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to