Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Receiving Message Multiple times for a client and Message Deletes after one client received

$
0
0

Hi All,

I have two clients listening to a subscription of topic .  I am seeing following issues.

Issue 1:

If one client receives a message and marks them completes other client won't receive that messages.

But i want all my clients to receive that message and acknowledge it so that once a client receives the message it shouldn't receive again

Issue 2:

If i don't acknowledge the message as complete . Some times i am receiving the message multiple times.

Issue 3:

During the Message Receive if see the Network disconnect. After some time it reconnects  I am receiving the messages from starting again.

For Sending the Message Code

============

if (!namespaceManager.TopicExists("DataCollectionTopic"))
                    namespaceManager.CreateTopic("DataCollectionTopic");
            if (!namespaceManager.SubscriptionExists("DataCollectionTopic", "one"))
                namespaceManager.CreateSubscription("DataCollectionTopic", "one");
            for(int i=0;i<100;i++)
            {
            BrokeredMessage bm = new BrokeredMessage("new Topic one");
            bm.Label = "hELLLOOOO xcvxvxcvxvxvxc DummyMEssage"+i;
            bm.Properties["StoreName"] = "asdasdasqwedas";
            bm.Properties["MachineID"] = "Bajjiiiqweq567567wii";

            if (namespaceManager == null)
            {
                Console.WriteLine("\nUnexpected Error");
                return;
            }
            MessageSender sender = messageFactory.CreateMessageSender("DataCollectionTopic");
            sender.Send(bm);

for receiving the message

===================

                                   

MessageReceiver receiver = await messageFactory.CreateMessageReceiverAsync("DataCollectionTopic/subscriptions/Vijay");

                while (true) { 

                 BrokeredMessage receivedMessage = receiver.Receive();

                try
                {
                  ProcessMessage(receivedMessage);
                 //  receivedMessage.Complete();
                }

                catch (Exception e)
                {
                    //  receivedMessage.Abandon();
                }
                }
            }

===============

TIA


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>