Hi,

I want to make sure I understand the asynchronous delivery mechanism.
I've implemented my MessageConsumer to do the following:

Add self to Connection's message consumer list
While(consumer is open){
        while(server is delivering synchronously){
                Send Receive Requests until the Server is Drained
        }
        Wait for Asynch Delivery
}


Is this the proper pattern?
Thanks,
fawce



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Hiram Chirino
Sent: Friday, January 10, 2003 6:50 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-dev] JBossMQ



Your kinda right.  the loop is there for the case where the destination
is queue based (p2p and durable subs).  The polling happens when the
queue is full.  Now when the queue is not full (or in the pub sub case,
there is no queue), then the thread goes into asynch mode and it waits
for the message to get delivered async via the ClientIL.receive method.
I'll comment the code a little:

       // gets the next message in queue or registers us for asynch
delivery if none available.
         mes = session.connection.receive( subscription, 0 );
         if ( mes == null ) // should always be null for pub-sub case.
         {
          // start waiting for the message to get delivered asynch
            waitingForMessage = true;
            while ( ( messages.isEmpty() && !closed ) || (
!session.running ) )
            {
               try
               {
                // messages gets signaled once ClientIL.receive finishes
processing the message.
                  messages.wait();
               } catch ( InterruptedException e )
               {
               }
            }
            if ( closed )
            {
               waitingForMessage = false;
               break outer;
            }
          // the message sent via ClientIL.receive should now be sitting
in messages
            mes = ( SpyMessage )messages.removeFirst();
            waitingForMessage = false;
        }


I hope that helped!  I think the XIL is great idea!  We might even be
able to develop a c base API to access mq services (important in the
integration space).

Regards,
Hiram


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of 
> John Fawcett
> Sent: Thursday, January 09, 2003 8:09 PM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-dev] JBossMQ
>
>
> Hi,
>
> I am working on a new invocation layer (IL) for JbossMQ that encodes 
> all communication in Xml (XIL). I've got the IL pretty near 
> completion, and I am working on a C# jbossmq client.  I am trying to 
> develop the TopicSubsciber, which is an extension of MessageConsumer. 
> In reviewing the code in the jbossmq java sources, it looks to me like

> the client to a topic actually runs a loop sending receive requests to

> the server regularly.
>
> Is this really necessary? Once the connection has been established, 
> why can't the server just invoke the ClientIL.receive method (which 
> actually sends the message to the client) when a message arrives at 
> the destination? It looks to me like the current implementation is not

> truly asynchronous...
> What am I missing?
>
> Thanks,
> fawce
>
>
> ---------------------------------
> John Fawcett
> CTO, Tamale Software, LLC
> 26 Fox Road
> Waltham, MA 02451
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! 
> http://www.vasoftware.com 
> _______________________________________________
> Jboss-development mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Jboss-development mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to