You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by daelliott <my...@outlook.com> on 2014/10/16 17:01:58 UTC

Newbie - Have working example - Looking for clarification on settings

I've created a working application loosely based on this example:
http://remark.wordpress.com/articles/transactional-message-processing-with-activemq-and-nms/

I'm able to publish and consume messages just fine although I haven't done
any performance testing.

My general requirements are 
* Use NMS ActiveMQ in a C# project
* Another department will publish to the queue and I will consume the
message
* I need to acknowledge the message was successfully processed - retry
processing if a failure occurred
* There will be a high volume of messages


General questions

1) consumer.Receive()  vs. consumer.Listener += OnMessage;
    Obviously receive will block and the event is asynchronous. 
    Other than that is there a reason to use one over the other (i.e.
performance )?

2) AcknowledgementMode - ClientAcknowledge / IndividualAcknowledge /
Transactional
    I know the response coding is different  
	message.Acknowledge();  
	
	session.Commit();
	session.Rollback();

    I've read the description:
http://activemq.apache.org/nms/msdoc/1.6.0/vs2005/Output/html/T_Apache_NMS_AcknowledgementMode.htm
    Individual and Client seem to be the same except that Client could
acknowledge multiple messages 
    at a time.  What I can't seem to figure out is why would I choose one
methodology over the other 
    when they all seem to do the same thing?

3) Consumer selector
    The example code has: session.CreateConsumer(this.queue, "2 > 1");  
    This ** seems ** similar to 2 &> 1 which redirects stderr to stdout.  
    What exactly is this "2 > 1" selector doing and is it really necessary
as there is an overload 
    that doesn't take a selector?

4) RedeliveryPolicy.MaximumRedeliveries
    After the maximum number of retries occurs, what happens to the message?

5) High volume
    I currently don't have a number for what this would look like, but in
general, is there 
    any setting, etc. that I should be looking at to ensure that I can
handle ** receiving ** 
    a large volume of data?


Thanks 




--
View this message in context: http://activemq.2283324.n4.nabble.com/Newbie-Have-working-example-Looking-for-clarification-on-settings-tp4686451.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Newbie - Have working example - Looking for clarification on settings

Posted by Tim Bain <tb...@alumni.duke.edu>.
2.  I believe (but haven't done it) that Individual will let you
acknowledge some messages (e.g. 1 and 3 but not yet 2), whereas Client
doesn't allow any gaps.  Both of those allow you to ack the message at any
point during your handling of it (when you first receive it, when you're
completely done, halfway through your business logic, whatever you need),
but they require you to explicitly perform the ack.  Auto acknowledge acks
the message right away, so if your client crashes before you've processed
the message it will be lost, but you don't have to write any code to do the
acking.  And I believe (but also haven't done it) that session transacted
acks automatically after the message has been processed (so if your client
crashes, it will be redelivered).  So it's all about when you want the
message to be acked and how much control you want.
3.  The ">" is not a redirect, it's a comparison operator.  Selectors are
there to say that a given consumer gets a message only when the comparison
evaluates to true.  It's often used with an equality test (e.g. does a
certain header match a tag that's assigned to this consumer), but
greater/less than can also be used depending on the data type against which
you want to compare.
4.  It'll go to the DLQ, if appropriate, or be discarded entirely otherwise.
5.  There are lots of knobs for performance tuning ActiveMQ, and no
one-size-fits-all solution for "going fast".  (If there was a turbo button
that worked in all cases, you can be sure it would already be on.)  Read up
on async sends <http://activemq.apache.org/async-sends.html>, prefetch
buffers <http://activemq.apache.org/what-is-the-prefetch-limit-for.html>,
and the broker's system limits and producer flow control
<http://activemq.apache.org/producer-flow-control.html>.
http://activemq.apache.org/how-do-i-configure-activemq-to-hold-100s-of-millions-of-queue-messages-.html
might also help you.

On Thu, Oct 16, 2014 at 9:01 AM, daelliott <my...@outlook.com> wrote:

> I've created a working application loosely based on this example:
>
> http://remark.wordpress.com/articles/transactional-message-processing-with-activemq-and-nms/
>
> I'm able to publish and consume messages just fine although I haven't done
> any performance testing.
>
> My general requirements are
> * Use NMS ActiveMQ in a C# project
> * Another department will publish to the queue and I will consume the
> message
> * I need to acknowledge the message was successfully processed - retry
> processing if a failure occurred
> * There will be a high volume of messages
>
>
> General questions
>
> 1) consumer.Receive()  vs. consumer.Listener += OnMessage;
>     Obviously receive will block and the event is asynchronous.
>     Other than that is there a reason to use one over the other (i.e.
> performance )?
>
> 2) AcknowledgementMode - ClientAcknowledge / IndividualAcknowledge /
> Transactional
>     I know the response coding is different
>         message.Acknowledge();
>
>         session.Commit();
>         session.Rollback();
>
>     I've read the description:
>
> http://activemq.apache.org/nms/msdoc/1.6.0/vs2005/Output/html/T_Apache_NMS_AcknowledgementMode.htm
>     Individual and Client seem to be the same except that Client could
> acknowledge multiple messages
>     at a time.  What I can't seem to figure out is why would I choose one
> methodology over the other
>     when they all seem to do the same thing?
>
> 3) Consumer selector
>     The example code has: session.CreateConsumer(this.queue, "2 > 1");
>     This ** seems ** similar to 2 &> 1 which redirects stderr to stdout.
>     What exactly is this "2 > 1" selector doing and is it really necessary
> as there is an overload
>     that doesn't take a selector?
>
> 4) RedeliveryPolicy.MaximumRedeliveries
>     After the maximum number of retries occurs, what happens to the
> message?
>
> 5) High volume
>     I currently don't have a number for what this would look like, but in
> general, is there
>     any setting, etc. that I should be looking at to ensure that I can
> handle ** receiving **
>     a large volume of data?
>
>
> Thanks
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Newbie-Have-working-example-Looking-for-clarification-on-settings-tp4686451.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>