[
https://issues.apache.org/jira/browse/AMQNET-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Timothy Bish resolved AMQNET-584.
---------------------------------
Resolution: Not A Problem
The issue reported is expected behavior. Please feel free to open an new issue
with a PR to fix the incorrect error message details.
> CheckMessageListener throws error when any listener exists
> ----------------------------------------------------------
>
> Key: AMQNET-584
> URL: https://issues.apache.org/jira/browse/AMQNET-584
> Project: ActiveMQ .Net
> Issue Type: Bug
> Components: NMS
> Affects Versions: 1.7.2
> Reporter: Joshua Ingham
> Priority: Major
>
> When following the example provided at
> [https://activemq.apache.org/components/nms/examples/nms-simple-asynchronous-consumer-example],
> I find that the consumer asynchronous listener throws an error in every
> case. That is:
> {{consumer.Listener += new MessageListener(OnMessage);}}
> The error thrown is "Cannot set Async listeners on Consumers with a prefetch
> limit of zero". However, I have a prefetch limit that is not zero.
> I tracked down some code at
> [https://github.com/ThorTech/apache-nms/blob/master/Apache.NMS.ActiveMQ/1.5.0/src/main/csharp/MessageConsumer.cs]
> which suggests that the function that handles receiving messages and checks
> for listeners always throws an exception:
> {{private void CheckMessageListener()}}
> {
> {{ if(this.listener != null)}}
> {{ {}}
> {{ throw new NMSException("Cannot set Async listeners on Consumers with a
> prefetch limit of zero");}}
> }
> }
> I understand that this may not be the most up to date code, but it would
> explain why I am seeing this behavior. Are asynchronous consumers actually
> supported? This exception, clearly out of place, suggests not, or it is a bug
> and nobody has stumbled upon this behaviour before.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)