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

Service Bus On 2012 Server

$
0
0

I have a service bus installed and confiured on Windows 2012 server I can connect and send messages and receive messages using brokered messages.

I am trying to create a notification hub using the on premise connection string but am getting error.

Any one can comment  on the connection string formation for a notification Hub.

MOMIN1412


Best Solution - Service Bus???

$
0
0

Hi all. I am building a hybrid system whereby a azure website (built using drupal with sql azure as the backend) will at it very basics allow people to clock into a workplace whilst being remote from the head office.

There will be a SQL On Premise DB with a WPF client that resides inside the office.

I want to be able to message the head office and update the WPF interal system as close to real time as possible as the people clock in and refresh a screen showing people arriving on site across many different sites. This works lovely by polling the SQL Azure database every 10 seconds but seems a very basic solution.

Are there any possibilities to ask sql azure to talk to service bus and then message the listening WPF app?

Thanks in advance

Scott 

IMessageSessionAsyncHandler supporting documentation

$
0
0

I have watched Abhishek Lal’s Build presentation (http://channel9.msdn.com/Events/Build/2014/3-636 ).

I’m just looking for some detailed documentation or sample code to match what Abhishek presented – especially around IMessageSessionAsyncHandler.  There is very little detail in the current MSDN docs (http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.imessagesessionasynchandler.aspx).  Could you point me to any other resources?

Thanks,

Terry

queenClient.ReceiveBatch(IEnumerable) throw MessageNotFoundException

$
0
0

Hi All,

     I want to use queueClient.ReceiveBatch(IEnumerable<long>) to remove brokenmessage from deadletter queue,below is my 

     code:

           

            bool success = false;
            if(messagingFactory == null)
                throw new NullReferenceException("messsagingFactory is null");
            try
            {
                QueueClient client = messagingFactory.CreateQueueClient(QueueClient.FormatDeadLetterPath(queuepath),                             ReceiveMode.ReceiveAndDelete);
                if (sequenceNumbers != null)
                {
                    client.ReceiveBatch(sequenceNumbers);
                }
                return true;
            }
            catch(Exception ex)
            {
                throw ex;
            }

 

          when above codes are executed,below exceptions is thrown:

          MessageNotFoundException:Failed to lock one or more specified messages.The message  doesn't exist.

         but I check that the SequenceNumbers are as the same as the brokenMessage. why throw this exception?         

         

   

   

MessagingCommunicationException

$
0
0

I am getting the following error message while polling for a message in the run method of a worker process.

Microsoft.ServiceBus.Messaging.MessagingCommunicationException was unhandled
  HResult=-2146233088
  Message=The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.
  Source=Microsoft.ServiceBus
  IsTransient=true
  StackTrace:
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.RunSynchronously()
       at Microsoft.ServiceBus.Messaging.MessageReceivePump.Start()
       at Microsoft.ServiceBus.Messaging.MessageReceiver.OnMessage(MessageReceivePump pump)
       at Microsoft.ServiceBus.Messaging.MessageReceiver.OnMessage(Action`1 callback, OnMessageOptions options)
       at Microsoft.ServiceBus.Messaging.QueueClient.OnMessage(Action`1 callback, OnMessageOptions onMessageOptions)
       at Microsoft.ServiceBus.Messaging.QueueClient.OnMessage(Action`1 callback)
       at .cs:line 39
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal()
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRole()
       at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<StartRole>b__2()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.ServiceModel.CommunicationException
       HResult=-2146233087
       Message=The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.
       Source=Microsoft.ServiceBus
       StackTrace:
         Server stack trace:
            at Microsoft.ServiceBus.Messaging.Channels.SharedChannel`1.CreateChannelAsyncResult.<GetAsyncSteps>d__7.MoveNext()
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.MoveNextStep()
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.EnumerateSteps(CurrentThreadType state)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
         Exception rethrown at [0]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.SharedChannel`1.OnEndCreateInstance(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.SingletonManager`1.EndGetInstance(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__2(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [1]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.RequestAsyncResult.<>c__DisplayClass17.<GetAsyncSteps>b__a(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [2]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__4(RequestAsyncResult thisPtr, IAsyncResult r)
            at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
         Exception rethrown at [3]:
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
            at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.EndReceiveCommand(IAsyncResult result, IEnumerable`1& messages)
       InnerException: System.Net.Sockets.SocketException
            HResult=-2147467259
            Message=An existing connection was forcibly closed by the remote host
            Source=System.ServiceModel
            ErrorCode=10054
            NativeErrorCode=10054
            StackTrace:
                 at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()
                 at System.ServiceModel.Channels.SocketConnection.BeginReadCore(Int32 offset, Int32 size, TimeSpan timeout, WaitCallback callback, Object state)
            InnerException:

Any ideas? I am running service bus 1.1 on a windows 8.1 machine and am using the 2.1.4.0 version of the service bus assemblies. The error is happening on start up and even before a message is put on the queue. The code works without any issues when connecting to a queue in the Azure cloud.

Service Bus ports error in documentation

Setting development environment for Service Bus 1.1 on Windows 7 and VS 2013

$
0
0

I must admit that I don't understand the connection between:

Windows Azure .NET SDK 2.1+ and Service Bus for Windows Server 1.1

I need a recommendation on how to correctly install development environment and recommended architecture for my problem:

I would like to use Event-Driven Message Programming Model to convert a Biztalk sequential activity/orchestration workflow that coordinates several WCF service calls that are correlated by an ID.
So instead of polling the queue I would like to use the new message pump.

I would like to use a Windows Server 2008 R2 windows service as a production machine and Windows 7 as a development machine. I have yet to see how the Biztalk orchestration is being called. I believe it had an inter call from a Java JSP pages or a desktop app calling a Biztalk WCF end point to start the workflow and then a number of asynchronous calls are made to different WCF endpoints (I believe .NET) sequentially waiting on the receiving end for the processing to finish and issue another similar calls.

I would like to user Rest API to talk to Service Bus and some lighter authentication like SharedSecret or SWT.

I was wondering if I need to have a client, a server and a listener at the minimum? I don' t know the role of the server and the listener (still learning).

I understand that Azure SDK includes some VS 2013 tooling and Azure libraries

There seem to be multiple ways to bring libraries on the develpment machines:

-Nuget packages

-Platfrom Installer

I currently have these installed:

-Visual Studio 2013 Update 1 RC

-Windows Azure SDK for .NET 2.2

I heard that the last compatible version of  Windows Azure Service Bus 2.1.4 nuget package

which contains Microsoft.ServiceBus.dll with

- Assembly Version 2.1.0.0 and

- File Version 2.1.31019.0 (I believe this is current version of the on-premises version of the Service Bus)

When installing Windows Azure SDK for .NET 2.2 I found Microsoft.ServiceBus.dll in

C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\v2.2\ref folder

Assembly Version 2.2.0.0

File Version 2.2.30924.1

So my questions:

    Any examples of Event-Driven Message Prog. Model (publish-subscribe and temporal decoupling)

    What tooling in VS 2013 does PI Windows Azure Service Bus 1.1 package installer provide?

    Any non-VS tooling like MMC or powershell commandlets?

    How to get any updates of .net libraries installed with above package?

    How Windows Azure SDK for .NET 2.2 is impacting Windows Azure Service Bus 1.1

i.e. can I have it installed or I have to uninstall it and install compatible version Windows Azure SDK for .NET 2.1?

    Or this compatibility only pertains to Nuget package:Windows Azure Service Bus currently

in 2.2.1.1 version and one needs to only obtain Windows Azure Service Bus 2.1.4 that is compatible with Windows Azure Service Bus 1.1?

Thanks,

Rad

AMQP implementation - acknowledge not working

$
0
0

I am testing the AMQP 1.0 with Azure service Bus queue.

When I call message.acknowledge() and I restart the java listener, then I receive again the message from the queue.

This is my code:

 sendSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        sender = sendSession.createProducer(queue);

        if (runReceiver) {
            // Create receiver-side Session, MessageConsumer,and MessageListener
            receiveSession = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
            
            receiver = receiveSession.createConsumer(queue);
            
            receiver.setMessageListener(this);
            connection.start();

    public void onMessage(Message message) {
        try {
 
            //System.out.println("Received message with JMSMessageID = " + message.getJMSMessageID());
        	String txt = message.getStringProperty("data");
            Gson gson = new Gson();
            Email email = gson.fromJson(txt, Email.class);   
            System.out.println("Messaggio ricevuto: " + email.From);
            System.out.println("Messaggio ricevuto: " + email.Body);
            message.acknowledge();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Any suggestion?


Giuseppe


Service Bus as "Communication Hub"

$
0
0

Hi All,

First off all, these questions all pertain to the Windows Service Bus (on-premise), cloud services are unfortunately not available to use because of the massive investment the company has already made in infrastructure (and the big boss said so :)

We've implemented WSB in our lab environment using 3 nodes and for messaging it works a treat. We're happy with the performance and resiliency the product has to offer.

However, we need direction in the following scenarios :

1.Multiple Sites
We have several sites globally that we would like to communicate between. However, the limitation for MSB are 5 nodes I believe. Additionally, the connectivity between some of these sites are horrific. Should we configure 3 nodes at each site and if so, how do we facilitate communication?

2.Not just message goodness
One of our developers are referring to a "hub/spoke" pattern for our existing WCF & WebAPI services. Essentially he wants to make the hub the central of all communication internally and between sites. Kind of like WCF relay's. Additionally, some of our sites have their own services.

I'm slightly skeptical of this idea as I believe there is an inherent latency in this. For example, If we'd like to call GetAvailableParts() in our site, one service is called but GetAvailablePArts() from another site could have a completely different contract.

A different example could be that all services are aware of the bus but not each other. The bus would facilitate communication.

How would we go around doing this or should we even consider it?

Any help would be appreciated!

Push notifications not working on 3.5 inch iPhones

$
0
0

Hello , 

I am an iOS developer and i am using WindowsAzureMessaging library 

I was working on my iPhone 5 and Push notifications was working well 

Until i discovered my app on iPhone 4s doesn't receive the push notifications 

I had two bad experiences using the azure messaging library :

1-Once the problem was that it's working good on iOS 7.0 and has bugs not sending on iOS 6.2 properly 

2- I downloaded a buggy sdk that refused to work until support answered me that there's an update and once downloading the update it worked good 

So I want to make sure if the problem is not a Microsoft side this time because every time it takes a lot of time and i discover that the problem is not from my side at the end 

Thanks in advance 

Yours , 

John Maher 

Not able to send notifications to Android devices

$
0
0

I have registered an Android device in my notification hub.

I can even fetch the registration details properly.

Even the tags are correct.

But when i send the notification then it is not received by the Android device(It is working fine with iPhone-different payload).

Any help is appreciated.

Here is my code to send the notification.

NotificationHubClient hubClient;
hubClient = NotificationHubClient.CreateClientFromConnectionString("Connection String", "Hub name");
string tag = "RelevantTag";
var result = await hubClient.SendGcmNativeNotificationAsync("{ \"data\" : {\"msg\":\"Hello from Azure!\"}}", tag);

ServiceBus SubscriptionClient.EndReceive() returns null

$
0
0

I call BeginReceive() on a SubscriptionClient like this:

client.BeginReceive(newTimeSpan(6,0,0),newAsyncCallback(DownloadResults),null);

And in the DownloadResults() callback I call client.EndReceive() [client is a static member of the class]

staticpublicvoidDownloadResults(IAsyncResult ar){// Get the message from the service bus.
    msg = client.EndReceive(ar);if(msg ==null){Console.WriteLine("Error!");return;}}

I noticed that sometimes client.EndReceive() returns null. It's not very clear to me by looking at the MSDN page for SubscriptionClient.EndReceive() as to exactly when EndReceive() returnsnull. Is it because the timelimit I specified in  BeginReceive() was exceeded? Or is it because there was an error?

Duplex messaging or Azure Queue Service

$
0
0

All ,

We have a requirement to develop a azure based platform, in which the user can configure multiple pharmaceutical instruments, start measurements on them and analyze the measured data. The typical components in the azure based platform will be following

1 - A .NET based 4 client application running on the computer connected to each instrument. This client application should receive the start measurement command from the azure platform , perform the measurement and update the result back to the azure*

2 - A set of services[probably REST based] which will get the results from the client application and update the database on the cloud

3 - A set of services and business logic which which can be used to perform analysis on the data

4 - A asp.net web application where the user can view instrument details , start measurement etc

There is a two way communication between the Azure platform and the client application i.e. the client needs to update results to the azure and the azure needs to initiate measurement on the instrument via the client application

In such a scenario , what is the recommended approach for the azure platform to communicate to the clients. Is it any of the following

1 - Create a duplex service between the client and server and provide a call back interface to start the measurement

2 - Create a command queue using Azure message queue for each client. when a measurement needs to be started , a message will the put on the queue. The client app will always read from the queue and execute the command

or do we have any other ways to do this , any help is appreciated

Request/response messaging pattern

$
0
0

All ,

I have a doubt on the Request response pattern... Assume the following is my scenarion

  1. I have a service running on Windows Azure. This  service can be called by users to execute a command.
  2. I have a client applications that is running on my intranet. This client application will execute the command . The computer in which the client application is running is connected to internet , but does not have a static IP i.e machine cannot be accessed directly via the internet
  3. I am planning to use Azure Service Bus through which my service on Windows Azure can communicate with the client application to execute.... 

In this scenario, can i use Request/response messaging i.e can the service post a message and expect a response from the client  

OR

Should i use command queue for each client , the Service will push the command to be executed on a queue , the client will poll the queue and execute a command

Any help is appreciated

Notification Hub authorization header

$
0
0

Hi all, 

I'm trying to use the Notification Hub REST api to send a GCM notification. I have read through the documentation on this page

http://msdn.microsoft.com/en-us/library/azure/dn223273.aspx

The bit I dont understand is the "Authorization" header. How am I supposed to generate this. I have been reading some blogs and everyone seems to say one thing. 

Am I supposed to use one of the following, or ALL?

- The SHARED ACCESS KEY that I generate from the Azure control panel under the "Configure" section?

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/3b3a7bb5-eaa0-497c-9ee8-856a1f5dfe7f/how-to-generate-a-sas-token-for-notification-hubs?forum=servbus) 

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/8aad223c-d299-4a1f-8eb4-3d4000a2b5ad/40103-invalid-authorization-token-signature-error-registering-to-notification-hub?forum=winappswithhtml5

- The Full Connection String?

- Shared Access Signature Authentication?

http://msdn.microsoft.com/library/azure/dn170477.aspx

I'm totally confused? 


Phonegap and Windows Azure Push notification services

$
0
0

Hello,

I would like to integrate my phonegap application with Windows Azure push notification services.

Any example/ tutorial on how to achieve that? 

http://azure.microsoft.com/en-us/documentation/articles/mobile-services-javascript-backend-phonegap-get-started/ Shows how to integrate mobile services but not the push notification.

Thank you

WCF Binding for Service Bus 1.1 for Windows server and way to consume it with a client

$
0
0
We have to Host a WCF service on IIS and Consume it with Service bus. We are not able to find any suitable test case where a WCF service uses Service Bus for window server. Available samples targets Window Azure service Bus and uses relay binding. But I think we have to use NetMessagingBinding for Service Bus 1.1 on windows server. A complete use case where Service Bus binding with WCF (Service Bus 1.1 for Windows Server) and way to consume it with a client will be helpful.

The request has timed out after 00:00:00 milliseconds.

$
0
0

Hello,

I am having weird exception when I try to send a message to a topic and there's nothing on the internet I could "google with Bing" about it.

Here's the error message

The request has timed out after 00:00:00 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded.

There are two things weird about it:

  1. The timeout period is 0 miliseconds
  2. The number of miliseconds is given in format 00:00:00

Here's the whole stack

Timestamp: 5.5.2014. 11:15:58
 Message: HandlingInstanceID: b9fcc3c8-c167-47ab-8473-ae45bfb62311
An exception of type 'System.TimeoutException' occurred and was caught.
-----------------------------------------------------------------------
05/05/2014 11:15:58
Type : System.TimeoutException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The request has timed out after 00:00:00 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded.
Source : Microsoft.ServiceBus
Help link : 
Data : System.Collections.ListDictionaryInternal
TargetSite : TAsyncResult End[TAsyncResult](System.IAsyncResult)
HResult : -2146233083
Stack Trace : 
Server stack trace: 

Exception rethrown at [0]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.TokenProviderHelper.EndGetAccessTokenCore(IAsyncResult result, String& expiresIn)
   at Microsoft.ServiceBus.TokenProviderHelper.EndGetAccessTokenByAssertion(IAsyncResult result)
   at Microsoft.ServiceBus.SharedSecretTokenProvider.OnEndGetToken(IAsyncResult result, DateTime& cacheUntil)
   at Microsoft.ServiceBus.TokenProvider.GetTokenAsyncResult.OnEndTokenProviderCallback(IAsyncResult result, DateTime& cacheUntil)
   at Microsoft.ServiceBus.TokenProvider.GetTokenAsyncResultBase`1.OnCompletion(IAsyncResult result)
   at Microsoft.ServiceBus.TokenProvider.GetTokenAsyncResultBase`1.<GetAsyncSteps>b__f(T thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.EnumerateSteps(CurrentThreadType state)
Exception rethrown at [1]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.TokenProviderUtility.GetMessagingToken(TokenProvider tokenProvider, Uri baseAddress, String appliesTo, String action, Boolean bypassCache, TimeSpan timeout)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.GetAuthorizationToken(String appliesTo, String action)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.GetAuthorizationHeader(String action)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.CreateWcfMessageInternal(String action, Object body, Boolean includeToken, String parentLinkId, RetryPolicy policy, TrackingContext trackingContext, RequestInfo requestInfo)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageCreator.CreateWcfMessage(String action, Object body, String parentLinkId, RetryPolicy policy, TrackingContext trackingContext, RequestInfo requestInfo)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.SendCommandAsyncResult.CreateWcfMessage()
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpTransactionalAsyncResult`1.<GetAsyncSteps>d__40.MoveNext()
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.EnumerateSteps(CurrentThreadType state)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.Start()
Exception rethrown at [2]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.<.ctor>b__1(IAsyncResult result, Boolean forceCleanUp)
   at Microsoft.ServiceBus.Messaging.BatchManager`1.PerformFlushAsyncResult.OnSingleOperationCompleted(IAsyncResult result)
Exception rethrown at [3]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.BatchManager`1.BatchedObjectsAsyncResult.End(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.BatchManager`1.EndBatchedOperation(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.BatchManagerAsyncResult`1.OnBatchedCallback(IAsyncResult result)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
Exception rethrown at [4]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnEndSend(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.MessageSender.RetrySenderAsyncResult.<GetAsyncSteps>b__f(RetrySenderAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
Exception rethrown at [5]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.TopicClient.EndSend(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Niva.Framework.Azure.Bus.AzureServiceBus.<EnqueueAsync>d__0.MoveNext() in c:\nivatech\papiri\source\framework\Azure\Bus\AzureServiceBus.cs:line 98
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Niva.Framework.Analytics.BusinessActivityLogRepository.<EnqueueAddAsync>d__29.MoveNext() in c:\nivatech\papiri\source\framework\Core\Analytics\BusinessActivityLogRepository.cs:line 51
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Niva.Papiri.Web.Controllers.BaseController.<RegisterActivityAsync>d__4.MoveNext() in c:\nivatech\papiri\source\web\site\Controllers\BaseController.cs:line 102
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Niva.Papiri.Web.Controllers.HomeController.<Index>d__0.MoveNext() in c:\nivatech\papiri\source\web\site\Controllers\HomeController.cs:line 35
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
Additional Info:
TimeStamp : 5.5.2014. 11:15:58
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : /LM/W3SVC/2/ROOT-1-130437489467023302

ServiceBus over AMQP/QPID client closes consumer

$
0
0

Hi,

We have on-premise installation of ServiceBus and Java JMS QPID client 0.26. It seems that there is bug in SB - it sends END command to consumer when producer closes connection. Both producer and consumer must run on the same machine.

First start consumer that listens on a queue:

static void consumeFromQueueForStackOverflow(Connection connection, Context context)
        throws JMSException, NamingException, InterruptedException {
    Session session = null;
    MessageConsumer consumer = null;
    long RECEIVE_TIMEOUT_MS = 30000;

    try {
        session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);

        Queue queue = (Queue) context.lookup("JBA_QUEUE");
        consumer = session.createConsumer(queue);

        connection.start();

        int consumed = 0;
        while (true) {
            long startMS = System.currentTimeMillis();
            Message message = consumer.receive(RECEIVE_TIMEOUT_MS);
            if (message != null) {
                consumed++;
                message.acknowledge();
                continue;
            }

            long durationMS = System.currentTimeMillis() - startMS;
            if (durationMS < RECEIVE_TIMEOUT_MS) {
                log.info(String.format("Connection is closed, timeout: %d[ms], waited: %s[ms] (consumed: %d)",
                        RECEIVE_TIMEOUT_MS, durationMS, consumed));

                break;
            }

            log.info(String.format("Receive timeout, retrying (consumed: %d)", consumed));
            consumed = 0;
        }
    } finally {
        connection.stop();

        if(null != consumer)
            consumer.close();
        if(null != session)
            session.close();
    }
}

Then post 1 message to the queue:

static void publishToQueueForStackOverflow(Connection connection, Context context)
        throws JMSException, NamingException, InterruptedException {
    Session session = null;
    MessageProducer producer = null;

    try {
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        Queue queue = (Queue) context.lookup("JBA_QUEUE");

        producer = session.createProducer(queue);
        producer.setDeliveryMode(DeliveryMode.PERSISTENT);

        TextMessage message = session.createTextMessage("My Message");
        producer.send(message);
    } finally {
        if(producer != null)
            producer.close();
        if(session != null)
            session.close();
    }

    log.info(String.format("Sent %d messages", count));
}

As soon as the producer process ends, the consumer will end too with waiting time smaller then timeout. The receive(timeout) method returns null prior to timeout expiration meaning (javadoc) "message consumer is concurrently closed". Alternatively you may see IllegalStateException: Closed during call to acknowledge().

Here is log from consumer. You can see that server sent unexpected End{} to client:

RECV[5671|0]:Open{containerId=087d0b7b8a8e4809a686f8b20d5376f5_GPRGXIT002,maxFrameSize=65536,channelMax=255,idleTimeOut=240000}
SEND[5671|0]:null
SEND[5671|0]:Begin{nextOutgoingId=0,incomingWindow=2048,outgoingWindow=2048,handleMax=4294967295}
SEND[5671|0]:Attach{name=IntegrationServiceBus/jba_testing_queue->(48ff030e-c7be-42b2-9c22-4d0db13aec8f),handle=0,role=receiver,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{}}
RECV[5671|0]:Begin{remoteChannel=0,nextOutgoingId=1,incomingWindow=2048,outgoingWindow=2048,handleMax=7}
RECV[5671|0]:Attach{name=IntegrationServiceBus/jba_testing_queue->(48ff030e-c7be-42b2-9c22-4d0db13aec8f),handle=0,role=sender,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{},initialDeliveryCount=0,maxMessageSize=262144,properties={com.microsoft:tracking-id=087d0b7b8a8e4809a686f8b20d5376f5_GPRGXIT002_BPRGXIT003;2411:54:55}}
SEND[5671|0]:Flow{nextIncomingId=1,incomingWindow=2048,nextOutgoingId=0,outgoingWindow=2048,handle=0,deliveryCount=0,linkCredit=100,drain=false,echo=false}
RECV[5671|0]:Transfer{handle=0,deliveryId=0,deliveryTag=\x84\xb8.\xf5\xda3\xafF\x89<J\x1bj\xda{<,messageFormat=0,more=false,batchable=true}
RECV[5671|0]:End{}
SEND[5671|0]:Detach{handle=0}
SEND[5671|0]:Disposition{role=receiver,first=0,last=0,settled=true,state=Released{}}
SEND[5671|0]:End{}
SEND[5671|0]:End{}
SEND[5671|0]:Close{}
RECV[5671|0]:Close{}

Can anybody help us with this issue?

Thanks a lot,

George


BrokeredMessage.CompleteAsync always gives ObjectDisposedException

$
0
0

message.CompleteAsync().ContinueWith(tr =>
                    {
                        if (tr.Exception != null)
                        {                       
                            Trace.TraceWarning("Failed to Complete BrokeredMessage \n" + tr.Exception.ToString());
                        }
                    });

--------------------------------------

Failed to Complete BrokeredMessage 
System.AggregateException: One or more errors occurred. ---> System.ObjectDisposedException: BrokeredMessage has been disposed.
   at Microsoft.ServiceBus.Messaging.BrokeredMessage.ThrowIfDisposed()
   at Microsoft.ServiceBus.Messaging.BrokeredMessage.EndComplete(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ObjectDisposedException: BrokeredMessage has been disposed.
   at Microsoft.ServiceBus.Messaging.BrokeredMessage.ThrowIfDisposed()
   at Microsoft.ServiceBus.Messaging.BrokeredMessage.EndComplete(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)<---

Viewing all 1916 articles
Browse latest View live


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