ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Persisting AMQP Messages

Post new topic  Reply to topic
 Persisting AMQP Messages « View previous topic :: View next topic » 
Author Message
jaycollett
PostPosted: Wed Oct 17, 2018 8:49 am    Post subject: Persisting AMQP Messages Reply with quote

Newbie

Joined: 17 Oct 2018
Posts: 1

I apologize for what may be a super simple question but a week of research and reading has left me without an answer. I'm using C# .NET and AMQPLiteNet to connect to an AMQP channel, I can send and receive messages on the specified topic just fine. My question is why can't I get MQ to save the messages posted to a topic when there are no subscribers listening for messages on the topic? All I want is the ability for MQ to save the messages posted by an AMQP client to a topic until a subscriber has "accepted" the message, but alas, I can't figure it out...

This is the .net code I'm using to send messages (which works fine) but if a client connects after the messages are sent, they never get them, even thoough no other client accepted the messages either...

Code:

static void Main(string[] args)
        {
            Address address = new Address("amqp://test:test@1.1.1.1:5674");
            Open openFrame = new Open();
            openFrame.ContainerId = "testAMQPClient";
            Connection connection = new Connection(address, null, openFrame, null);
            Session session = new Session(connection);

            SenderLink sender = new SenderLink(session, "shared:persistTest", "test");
            for(int i = 100; i <= 200; i++){
                Console.WriteLine("Sending message " + i.ToString());
                Message message = new Message("Hello From C# " + i.ToString());
                message.Properties = new Amqp.Framing.Properties();
                message.Properties.To = "";
                message.Header = new Amqp.Framing.Header();
                message.Header.Durable = true;
                message.DeliveryAnnotations = new DeliveryAnnotations();
               

               
                sender.Send(message);
                System.Threading.Thread.Sleep(2000);
            }
        }
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 17, 2018 9:32 am    Post subject: Re: Persisting AMQP Messages Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

jaycollett wrote:
My question is why can't I get MQ to save the messages posted to a topic when there are no subscribers listening for messages on the topic?


Because as far as I know, AMQP doesn't support that concept. Messages can be durable, which means they're persisted to disc and will be stored until the subscriber acknowledges receipt but I don't believe they can be retained in the way an MQ publication (i.e. one using the native MQ C++ classes) can be.

Someone who knows more about AMQP than I do may be along in a minute to disagree with me and I will defer to them if they do.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Persisting AMQP Messages
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.