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

FIFO Message Processing and Event Grid

$
0
0

Hi All,

Forgive my posting in this forum (Event Grid does not seem to be an option). I have a scenario where I am synchronising CRM customer records to other systems. I am using an Event Grid however realise that there is no guarantee in the order of processing. In my case every time there is a change in the source I send a snapshot of the core fields (name, id, address etc) so I am only interested in the latest version of the record. I have not encountered it yet but if updates somehow arrive out of sequence is there a simple way to ignore them. I would have to persist the versioning in the integration layer as some of the downstream systems could not store this data. Also open to using event hub or service bus but if the records are out of order before hitting the "queue" is there any way to correct them perhaps stream analytics?

Regards 


ARM templates for service bus queue in Azure monitor

$
0
0

I have created metric alert for Azure service bus namespace using ARM templates and deployed successfully.

Issues:

In "Condition" section we have option called "DimensionName", under "EntityName" -> will check box select* to monitor under the service bus namespace. How to add that part name in ARM templates




Vinoth

System.TimeoutException while processing service bus message

$
0
0

(this issue has been moved from https://social.msdn.microsoft.com/Forums/azure/en-US/a62c4956-655e-4419-bf64-d17fee8243fe/systemtimeoutexception-while-processing-service-bus-message?forum=AzureFunctions)

I have developed an Azure Function, running on the consumption plan, consuming a message from a service bus topic and publishing a new message on another topic. I sometimes see the following exception in the log:


Microsoft.Azure.WebJobs.Host.FunctionInvocationException:Exceptionwhile executing function:UptimeChecker--->System.InvalidOperationException:Errorwhile handling parameter msg after function returned:--->System.TimeoutException:The request operation did not complete within the allotted timeout of 00:00:51.9333128.The time allotted to this operation may have been a portion of a longer timeout.For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:5cf70cdf-5558-4f3c-9599-a47cc82f52d9, Timestamp:12/15/2017 6:27:23 PM
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<>c.b__9_3(RequestAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)---End of stack trace from previous location where exception was thrown ---
   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__DisplayClass8_1.b__4(RequestAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)---End of stack trace from previous location where exception was thrown ---
   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.<>c.b__9_3(RequestAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)...

The function app itself is a precompiled function app with the following signature:

publicstaticvoidRun([ServiceBusTrigger("%inputTopicName%","%subscriptionName%",AccessRights.Manage,Connection="connection")]string mySbMsg,TraceWriter log,[ServiceBus("%outputTopicName%",Connection="connection",EntityType=Microsoft.Azure.WebJobs.ServiceBus.EntityType.Topic)]outstring msg)

I have the same function app running in 5 different regions. Currently, I'm not in a position where I can see which region is failing in my error log. But it is one of these 5:

  • elmah-io-uptime-checker-east-us
  • elmah-io-uptime-checker-north-eu
  • elmah-io-uptime-checker-southeast-au
  • elmah-io-uptime-checker-south-uk
  • elmah-io-uptime-checker-west-us

Application Insights show the error, but I don't think that it provides me with more details than the stack trace and error message I already have in my own log.

I did notice something in the original stack trace, though: "Error while handling parameter msg after function returned". The stack trace says "msg", which would translate to the out parameter in the signature. That also matches "after function returned" from the trace.


So, it seems like my code is setting a string in the out parameter and returns. When the job host (running after my code returns), needs to deliver the message to service bus, it fails. Since this happens outside the scope of my code, I am not able to add any retry logic. I also see the following term in the stack trace: "RetrySenderAsyncResult". This indicates that the ServiceBus output binding is already implemented to retry.

An option here is to remove the out parameter and deliver the message to service bus myself, using a more consistent retry strategy. But I would rather use the features build into functions, than to roll my own implementation.

Any ideas?

Azure Event Hub Not Connecting

$
0
0

Hi,

I am following this tutorial-  https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-python-get-started-send

to send events to my event hub using Python

The connection string of my Event Hub namespace is in the following format

Endpoint=sb://<eventhubnamespacename>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<AcessKeyvalue>

So, in the above mentioned tutorial, I have replaced tutorial I replaced 

ADDRESS with"amqps://mynamespace.servicebus.windows.net/<myeventhub>"
User="RootManageSharedAccessKey"
KEY="<AcessKeyvalue>"

But everytime , I run into errors with the line client.run

'eventhub.pysdk-ANumber': All clients failed to start.

azure.eventhub.common.EventHubError: Unable to open authentication session on connection b'EHSender-anumber-partition0'.
Please confirm target hostname exists: b'eventhubnamespacename.servicebus.windows.net'

I have even tried replacing amqps with sb (as is actually in the connection string but the same error)

Where am I going wrong? 




Azure Service Bus: send Messages to queue via amqp rceive only requests no messages

$
0
0

Hallo,

i am using a third party tool to send messages via amqp v1 to a queue. Currently i reveive only requests at the queue , no messages. (see immage)

I guess that i configured the security stuff right, because the requests are sucessfull. Does anybody maybe know what setting i am missing , or what does this mean?!

Why only request? 

For Example : Azure Metrics

  • Incoming Requests      ->9
  • Succesfull Requests     ->9
  • Incomming Messages  -> 0
  • UserErrors                  ->0
  • AMQP V1.0
  • Port 5671
  • SSL/Https

i am sending Json(utf-8) in the body. 

thanks Christian 


 

How best to control/manage access to Azure Service Bus at the machine/client level?

$
0
0

Our internal network is configured to prevent our development environment from "seeing" our production environment (and visa-versa).

Using Microsoft Azure Service Bus, using the connection string (ex. sb://myBus.servicebus.windows.net), is there a way to manage access at the machine level? 

Ex. Allow DevServerA to 'see' sb://myDevelopmentBus, but not 'see' sb://OurProductionBus

Blocking via IP doesn't work because both connection strings resolve to the same IP address.


Abandon() in azure service bus , method takes message to dead letter queue

$
0
0

Hi All,

  I'm new to azure service bus, I'm developing a sample publish/subscribe application using java sdk. In this exercise what I want to achieve is I will publish 50 messages (json)to a queue, these are in below format.

[{'lastname'='test0','firstName'='success0'}...{'lastname'='test49','firstName'='success49'}]

In receiver application at 25th message , I want this message to abandon, so the 25th message will be

available in queue. But when I run application, all 49 messages are completed and one message went to

dead letter queue. I got below exception.

Either receive link to 'asb.java.pub' closed with a transient error and reopened or the delivery was already settled by complete/abandon/defer/deadletter.
2019-05-09 06:17:19 ERROR MessageAndSessionPump:241 - Completing message with sequence number '5002' failed
java.lang.IllegalArgumentException: Delivery not found on the receive link.
at com.geico.messaging.servicebus.primitives.CoreMessageReceiver.generateDeliveryNotFoundException(CoreMessageReceiver.java:1319)
at com.geico.messaging.servicebus.primitives.CoreMessageReceiver.updateMessageStateAsync(CoreMessageReceiver.java:1161)
at com.geico.messaging.servicebus.primitives.CoreMessageReceiver.completeMessageAsync(CoreMessageReceiver.java:1046)
at com.geico.messaging.servicebus.MessageReceiver.lambda$3(MessageReceiver.java:267)
at java.util.concurrent.CompletableFuture.uniComposeStage(Unknown Source)
at java.util.concurrent.CompletableFuture.thenCompose(Unknown Source)
at com.geico.messaging.servicebus.MessageReceiver.completeAsync(MessageReceiver.java:262)
at com.geico.messaging.servicebus.MessageReceiver.completeAsync(MessageReceiver.java:255)
at com.geico.messaging.servicebus.MessageAndSessionPump.lambda$6(MessageAndSessionPump.java:220)
at java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
at java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

.here is my publishing code

ConnectionStringBuilder connectionResolver = new ConnectionStringBuilder(connectionString, "asb.java.pub"); 

QueueClient sendClient = new QueueClient(connectionResolver,ReceiveMode.PEEKLOCK);

for(int i =0;i<50;i++){Message message = new Message("{'lastname' = 'test"+i+"', 'firstName' ='success"+i+"'}");

message.setLabel("name");sendClient.send(message);}sendClient.close();

here is my subscriber code
IMessageHandler ih=new IMessageHandler() {				
public CompletableFuture<Void> onMessageAsync(IMessage message)   {
byte[] body = message.getBody();					
Map map = GSON.fromJson(new String(body, UTF_8), Map.class);	
try{						if(map.get("lastname").equals("test25")){						return receiveClient.abandonAsync(message.getLockToken());
;
}catch(Exception e){						e.printStackTrace();						
}
CompletableFuture.completedFuture(null);
}
public void notifyException(Throwable throwable, ExceptionPhase exceptionPhase) {
					System.out.printf(exceptionPhase + "-" + throwable.getMessage());
}
};

			receiveClient.registerMessageHandler(ih, executorService);

my question is why message goes to deadletter , when I call abandon method. Can't I made a specific message to abandon or autocomplete false.So that that message will be available in the queue .

Thank you.


Auto-delete service bus subscriptions on Idle

$
0
0
Hi, we are using (on-premise) Windows Service Bus as a messaging channel (publisher/subscriber model) for our applications and services.
There's one specific scenario i would like to describe here since so far we couldn't find a solution to the following:

1. We have multiple topics and multiple subscriptions set on each topic
2. Messages are published synchronously to all the topics (aproximately 1000 messages per second with the average size of about 250 bytes per message) 
3. We are keeping messages alive only for a short periods of time by setting DefaultMessageTimeToLive on each subscription
4. If one application disconnects, we want to auto-delete its subscription after awhile and reinitialize it when the application is started next time

It is the Part 4 that is giving us troubles.
Setting AutoDeleteOnIdle on a subscription doesn't seem to work. 

Any help would be highly appreciated!

My queue is not listed when I create a Logic App trigger

$
0
0

I have established a queue and sent messages to it. 

I go to create a Logic App and use the trigger "When a message arrives on a queue (autocomplete)", but my queue is not listed. 

I have checked and the queue appears to be in the same resource group as the Logic App, but it is not very clear.  Am I missing something?

Thanks, 
J

Azure Service Bus Topic

$
0
0

I am using Service Bus topics in my applications. the messages are published successfully from the application, however the subscribed applications are not receiving the message (event is not triggered) and the outgoing message in azure portal is stuck at 1. 

Max Delivery Count with Azure Service Bus Topic Trigger

$
0
0

Configured service bus topic with a subscription which has MaxDeliveryCount set to 10 and DeadLetterQueue..  For the same service bus topic have created a service bus topic trigger. In the service bus topic trigger forcibly setting the exception to make the message as Abandon.

However message is going to DeadLetterQueue without reaching MaxDeliveryCount. Service Bus Topic Trigger is not getting triggered for Abandon messages until it reaches MaxDeliveryCount. Is PeekLock behavior is not available for Service Bus Topic Trigger? 

Code for Service Bus Topic Trigger;

using System;
using System.Threading.Tasks;
publicstaticasync Task Run(string mySbMsg, Int32 DeliveryCount,string MessageId,TraceWriter log)
{
try
    {
     log.Info($"C# Azure Service Bus Topic trigger function saved file: {mySbMsg} ");
        log.LogInformation($"DeliveryCount: {DeliveryCount}");
     await SampleFunction(log);
    }
    catch(Exception ex)
    {
        log.Info($"Exception: {ex} ");
        throw ;
                
    }
}
publicstaticasync Task SampleFunction(TraceWriter log)
{
log.Info($"C# Azure Service Bus Topic trigger function SampleFunction: ");
thrownew ArgumentNullException("argument");
}

 

 

Azure Service Bus deprecated - Service management - ARM

$
0
0

Dear community,

First of all i'm new on the azure platform so please forgive me if this is a stupid question.

For a new startup we are building integration with the Azure Service Bus. Now i got a link from a co-worker saying that azure service bus is deprecated and that we should look for another solution?

https://blogs.msdn.microsoft.com/servicebus/2018/11/01/deprecating-service-management-support-for-azure-service-bus-relay-and-event-hubs/

The way i read it service bus is not deprecated but it used a different template / technology on the background? SM or ARM, and ARM is of course the newer one.

Anyone who can enlighten me on this topic?

Thank you in advance!!!


Azure Service Bus Sessions - possible starvation

$
0
0

I have a background processor that listens to a service bus queue and messages need to be processed in order per Session ID.

I'd like to ensure that no more than 5 messages are processed in parallel - meaning I'd like to process 5 sessions at once.

If there are more than 5 sessions at any given time, is there any way I can ensure that all sessions are eventually handled?

Even if I drop a certain session and then accept a new session after that, the same session might be processed again.  Can I ensure that the accepted session is the one that contains the oldest unprocessed message?

Queue message disappears

$
0
0

I have a Service Bus with multiple Queues. Setup looks like this:



When i put a message in the queue, it sits there for a little less then a minute and then it disappears. I have no triggers looking at this specific queue. How can that be explained?

The real issue is, that the same thing happens on all other queues, where I do have triggers. This behavior results in loss of messages.

Put Queue length on the Dashboard

$
0
0

Hi All,

Is there a way to expose the length of all our Service Bus queues on the excellent Azure dashboard ("new" portal)? When viewing the queues we can see the queue length as an available stat, but no way to pin it to the Dash.

We could of course create our own simple dashboard, but we'd prefer to have all our important telemetry in one place. It also looks cooler! :D

regards

Tim


VDI for the win!


How retry works in Azure Service Bus Java

$
0
0

Hello Experts,

          I'm new to service bus, I'm curious about RetryPolicy and how it works, as per the documentation, retry had happened automatically for transient exceptions(MessagingExcepitons, ServerBusy), and the default retry count is 3, but we can set out custom retry policy using RetryExponential class. I want to see the logs does the RetryPolicy did actually trying  to connect or not when exception ouccres. How can I check this, how to replicate  MessagingExcepitons, ServerBusy exceptions , so that I can see the logs. 

Can any one help me to understand this. Thanks in advance

 

Azure SDK for Python | peek() doesn't work

$
0
0

Hello,

When I try to peek at messages in a topic subscription with a count of say, five, I can only get the first two messages although the subscription has 10+ messages. Here's what I'm trying:

subscription_client = SubscriptionClient.from_connection_string(CONNECTION_STR
, name=SUBSCRIPTION_NAME, topic=TOPIC_NAME)

with subscription_client.get_receiver() as receiver:   
    messages = receiver.peek(count=5,start_from=None)
    for message in messages:  
         print(message.message,"\n")

I also noticed that for subscriptions with 100+ messages, I could only peek at first four messages.

Please help.


Can't create a Queue in my Service Bus Namespace

$
0
0

Hi,

When i try to create a Queue in my Namespace (basic pricing), even if I let all the settings by default I Have an exception like that  :

Id in request does not match Id in payload. CorrelationId: e38b63b3-240a-41c4-934f-582f1d5c0698

Any ideas ?


Nicolas


Message Processing.

$
0
0

Hi, 

I have a ServiceFabric cluster that contains a number of MicroServices that post messages/events to a message bus. 

I have a issue when the services scale out which can then cause messages to be processed out of order. Does SB have a way to control message processing orders etc.

Thanks

Event Grid Endpoint 429 Error - Higher than Allowed Bitrate

$
0
0

Hello, new to the forums, please forgive me if this topic is posted in the wrong spot and direct me to the right place if so.

I am trying to write a PS script to post a json to an Event Grid endpoint. 

Invoke-WebRequest-Uri $endpoint-Method'Post'-Headers $header-Body $body

I am using the Invoke-WebRequest function with variables set above. It SEEMS to be well crafted, but when I kick off the script I eventually get the following error:

{ "error": { "code": "429", "message": "Topic MY-CUSTOM-TOPIC-1.WESTUS2-1.EVENTGRID.AZURE.NET is
being sent a higher than allowed 'byte rate'. Request length = 0, Current rate = 291 bytes/second. Allowed rate =
26214400 bytes/second. Report '6433d9cb-ddae-4394-96e9-7aa1c0fbd727:6/3/2019 6:54:50 PM (UTC)' to our forums for
assistance or raise a support ticket.", "details": [{ "code": "TooManyBytes", "message": "Topic
MY-CUSTOM-TOPIC-1.WESTUS2-1.EVENTGRID.AZURE.NET is being sent a higher than allowed 'byte rate'. Request length = 0,
Current rate = 291 bytes/second. Allowed rate = 26214400 bytes/second. Report
'6433d9cb-ddae-4394-96e9-7aa1c0fbd727:6/3/2019 6:54:50 PM (UTC)' to our forums for assistance or raise a support
ticket." }] } }

In this case it seems that the byte rate that is being sent is well under the allowed rate, yet I am still getting a TooManyBytes error.

Why is this the case?

Viewing all 1916 articles
Browse latest View live


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