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

Windows Service Bus receive function 64bit int

$
0
0

Hy,

I want to use the ReceiveBatch-Methode (IEnumerable(Int64)) in C#. It needs a IEnumerable(Int64 -> long). I need this function because in the GetMessageNumber(topicName, subscriptionName) function I use the intern counter from the service Bus wihich returns a long value. The other receive function only offer a int. I tried this function but I always get an MessageNotFoundException was unhadeld by user code.

> Failed to lock at least a specified message. The message is not
> vorhanden..TrackingId:a2e6b0f0-fd3d-4594-935d-936ff7b3210c_GLBHPC0474_BLBHPC0474,TimeStamp:28.03.2014
> 13:41:57

http://msdn.microsoft.com/de-de/library/jj657801.aspx

            IEnumerable<long> messageNumber = new long[]
            {
                GetMessageNumber(topicName, subscriptionName)
            };

            IEnumerable<BrokeredMessage> messages = null;

                try
                {
                    //Receives a message using the InternalReceiver.
                    messages = subscriptionClient.ReceiveBatch(messageNumber);


But the I tried it with the int function ReceiveBatch-Methode (Int32) and it worked. The problem is that I need the function with the long value and why they use an IEnumerable to use the receive function with the 64 bit value? How I can accomplish to use the function with the 64 bit value correct?

            IEnumerable<BrokeredMessage> messages = null;

            long messageNumber = GetMessageNumber(topicName, subscriptionName);

                try
                {
                    //Receives a message using the InternalReceiver.
                    messages = subscriptionClient.ReceiveBatch(messageNumber);

Best regards


Viewing all articles
Browse latest Browse all 1916

Trending Articles



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