Hi!
At 02:58 5.9.2001 +0200, you wrote:
>Kovi,
>
>There's a reasonable chance that I haven't fully understood things.
Can be..
>As I understand it, if I want to consume messages on a queue
>asynchronously, I write a class which implements the MessageListener
>interface (onMessage of course), and pass this to the setMessageListener
>of a MessageConsumer object.
You create a QueueReceiver class using queue session and call
setMessaListener() on it. Example:
public class MyListener implemenets MessageListener
{
public void onMessage(Message message)
{
Systemout.println("Message arrived !");
}
public void init()
{
// first get queue connection factory, ....
queueConnection.setMesasgeListsner(this);
}
public static void main(String args[])
{
MyListener listener = new MyListener();
listener.init();
}
}
>To get this going I have to implement a "main" method to create the
>MessageConsumer instance - correct? Now the router will call the onMessage
>method when messages arrive.
Right.
>What I was thinking was that it would be neater to allow a MessageListener
>Java class
>to be specified in the router properties file in the 'queue' section, so the
>router
>fires up an instance of this class and automatically wires it to the queue.
With the current release you cannot do this.
You will be able to do that with version 3.0.0. Andreas said it would be
available in fall this year. It will have an API for swiftlets. So you
could write your own swiftlet allowing you to do what you want.
I hope I understood him OK.
>Probably I'm missing some critical points which mean this isn't possible.
>
>Many thanks
>Paul.
Best regards,
Kovi
------------------------------------------------------
SwiftMQ developers mailing list * http://www.swiftmq.com
To unsubscribe from this list, send an eMail to
[EMAIL PROTECTED] and write in the body of your message:
UNSUBSCRIBE developers <your-email-address>
Archive: http://www.mail-archive.com/[email protected]/