qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignacio Ybarra <ignacio_yba...@hotmail.com>
Subject RE: Last Value Queue LVQ using dotnet API / last value cache
Date Tue, 27 Oct 2009 01:41:12 GMT

 <5823B241362C1A418501F88C3F0DA900049BA5A5@TK5EX14MBXC141.redmond.corp.microsoft.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


Tried the following with no success:
=20
  session.attachMessageListener(this=2C "myDest")=3B
  session.messageSubscribe("q1"=2C "myDest"=2C MessageAcceptMode.EXPLICIT=
=2C MessageAcquireMode.NOT_ACQUIRED=2C null=2C 0=2C null)=3B
=20
Am I missing something like this?

  //session.messageSetFlowMode("myDest"=2C MessageFlowMode.WINDOW)=3B
  //session.messageFlow("myDest"=2C MessageCreditUnit.BYTE=2C ClientSession=
.MESSAGE_FLOW_MAX_BYTES)=3B
  //session.sync()=3B

=20
The following works=2C but I can't set MessageAcquireMode.NOT_ACQUIRED usin=
g these methods:
=20
  session.attachMessageListener(this=2C "q1")=3B
  session.messageSubscribe("q1")=3B

=20
(both snippets above are followed by: while (true) { Console.WriteLine("sle=
eping")=3BThread.Sleep(1000)=3B} )
=20


----------------------------------------
> From: jbird@microsoft.com
> To: users@qpid.apache.org
> Subject: RE: Last Value Queue LVQ using dotnet API / last value cache
> Date: Tue=2C 27 Oct 2009 01:25:31 +0000
>
> I just had to figure this out myself. MessageAcquireMode.PRE_ACQUIRED is =
exactly what you DON'T want=2C because acquiring a message removes it from =
the queue. NOT_ACQUIRED will leave it in the queue.
>
> -----Original Message-----
> From: Ignacio Ybarra [mailto:ignacio_ybarra@hotmail.com]
> Sent: Monday=2C October 26=2C 2009 5:44 PM
> To: users@qpid.apache.org
> Subject: Last Value Queue LVQ using dotnet API / last value cache
>
>
> Hello=2C
>
> I have been trying to set up a Last Value Queue using your dotnet API (cl=
ient0-10). Most of it works great -- apart from consuming messages without =
taking them from the queue (peek).
>
> Basically I want the consumer/listener to receive by not remove the msg f=
rom the lvq=2C i.e. the setup to work as a last value cache.
>
> Since I couldn't find parameters/methods to set this up using the interfa=
ce=2C I have taken the steps below.
>
> The setup part of my code looks like this:
>
> session.exchangeDeclare("ig.direct"=2C "direct"=2C null=2C null=2C new Op=
tion[] { Option.DURABLE })=3B
> session.queueDeclare("q1"=2Cnull=2Cnew Dictionary(){{"qpid.last_value_que=
ue"=2C1}}=2C new Option[] { Option.DURABLE })=3B
> session.exchangeBind("q1"=2C "ig.direct"=2C "routing_key")=3B
>
> The sender/publisher part of the code looks like this (in reality I send =
a batch of msgs so they get overwritten):
> //List messages =3D new List() =3B
> //for (int i =3D 0=3B i < Program.NUM_MSGS=3B i++)
> //{
> IMessage message =3D new Message()=3B
> message.DeliveryProperties.setRoutingKey("routing_key")=3B
> message.DeliveryProperties.setDeliveryMode(MessageDeliveryMode.PERSISTENT=
)=3B
> message.appendData(Encoding.UTF8.GetBytes("Message "))=3B// + i))=3B
> message.ApplicationHeaders.Add("qpid.LVQ_key"=2C "INTC")=3B
> //messages.Add(message)
> //}
> session.messageTransfer("ig.direct"=2C message)=3B//s[i])=3B
>
>
> The receiver/listener looks like this:
>
> session.attachMessageListener(this=2C "q1")=3B
> session.messageSubscribe("q1")=3B
> //public void messageTransfer(IMessage m)
> //{
> //...
> // Console.WriteLine("Message: " + message)=3B
> //}
>
> All works with this setup=2C but the message is removed from the queue.
>
> I have also tried the following in the listener=2C but in this case the c=
allback does not get any messages:
>
> session.attachMessageListener(this=2C "myDest")=3B
> session.messageSubscribe("q1"=2C "myDest"=2C MessageAcceptMode.EXPLICIT=
=2C MessageAcquireMode.PRE_ACQUIRED=2C null=2C 0=2C null)=3B
>
> Any clues? Many thanks in advance.- ig
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 		 	   		  =

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message