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

Getting Lock Lost exception under "Lock duration" period set on Topic Subscription

$
0
0

Hi

We are polling a Service Bus Topic subscription using Azure Logic Apps in PeekLock Mode.
The Lock duration on the subscription is set to 5 minutes.

Now, we are observing inconsistent behavior while trying to complete the message.
After a duration of 1:06 secs, while trying to complete the message, we got Lock Lost exception:

Failed to complete the message with the lock token 'db351bdb-4e93-4a98-8563-ea20b5f7af14'. The lock on the message has been lost.\r\nclientRequestId: 58e3b9cc-85ac-40da-ae40-439f5220dcc5

There have been instances before when the processing took 3 mins, but we did not get this exception.
TThe expectation is that we will only receive this exception if ~5mins have elapsed.

Any inputs are appreciated.


Thanks Arindam



About ServiceBus DR Scenario

$
0
0

I am writing in reference to the DR scenario of ServiceBus. I have a question regarding to this system.

I  verified that ServiceBus is capable of  being manual failover from primary to another region secondary

 in case of disaster and outage by setting up the Dpairing

In this cace, entity and settings would be replicated and not about messages.

I  verified that worked

OK , here is the question.

In case of the system like consumer’s demand for sequencing and ordering, some message would be skipped by the manual failover

by using of session id for ordering.

I mean, I'm afraid inconvenience for consumers would be happened.

What is the effective step when the system by using ServiceBus?

Resubmit deadletter message to subcription

$
0
0

Hi

We have a scenario where a message fails multiple times for a particular subscriber and is sent to the deadletter queue. Particular deadletter messages we want to resubmit to the particular subscriber at a later time.

I cannot see a way to do this. I try to resubmit to the subscriber's queue doing something like the following:

var subscriptionPath = SubscriptionClient.FormatSubscriptionPath(topicName, subscriptionName);
var client = QueueClient.CreateFromConnectionString(connectionString, subscriptionPath);
client.Send(brokeredMessage);

But this causes an Invalid Operation exception with message Cannot open a Queue client for entity type Subscriber.

I'm able to resubmit it to the topic, but that means all subscribers receive it, so I don't want to do this.

How do I do this? If I'm not able to, what is recommended instead?

Thanks

Need help on Spring-Cloud-Stream ( spring-cloud-azure-servicebus-queue-stream-binder) - Retry and DLQ implementation

$
0
0

 Hi All,

we are trying to migrate from rabbitmq(pcf service) to azure service bus.

our previous implementation used spring ampq and rabbitmq as message broker. but now trying rewrite using spring cloud stream. so to avoid message broker dependency in future

Azure-Spring-cloud-stream-binder example :

https://docs.microsoft.com/en-us/azure/java/spring-framework/configure-spring-cloud-stream-binder-java-app-with-service-bus 

using above link we are able to implement basic messaging. But couldn't find the reference related to DLQ and Retry(Exponential Retry) error handling mechanism using spring cloud stream for azure service bus.


Apache Kafka example:  

In the below link their is guide fo dlq processing for kafka and similar can be found for rabbitmq. looking for similar example using spring-cloud-azure-servicebus-queue-stream-binder

https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html#kafka-dlq-processing



any help is appreciated, Thanks for help in advance:)

Does Service Bus support Kafka?

$
0
0

Are these two tools alternative to each other or could service bus work with kafka protocol/interface?


Kenny_I

Is Topics and Subscriptions possible with Azure Event Hub?

$
0
0
Is is possible to consumer like Azure Functions to subscribe certain topics from EventHub or is it only Service Bus feature?

Kenny_I

[Azure Event Hub] Difference between two connections string

$
0
0

Hello,

I try to connect my kafka to an eventhub. I follow steps on official microsoft tutorial , Integrate Apache Kafka Connect support on AzureEvent Hubs (Preview)

But in file configuration ( connect-distributed.properties ) i don't understand a little part.

In this line sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}";

What is the difference between the $ConnectionString and YOUR.EVENTHUBS.CONNECTION.STRING ?

Best Regards.

Briac


Message lock lost - service bus outage?

$
0
0

Trying to troubleshoot what seems to be an Azure service bus issue - the message consumer is logic apps, but this felt like the more appropriate forum.

I completed a load test over the weekend, around 8500 messages processed successfully, but 5 errors. 4 of the errors occurred at very close to the same time, which is why I'm suspicious of some kind of outage.

I have a logic app consuming messages from the service bus - it is configured currently to process up to 10 messages concurrently. For the 5 errors, it appears as if there is some kind of issue when marking the message as 'complete' and hence removing it from the queue - the logic app reports a 'Gateway timeout', and on automatically retrying the same step receives a message from the service bus:

"Failed to complete the message with the lock token '250e397b-f3d1-45e4-9e6f-e07e79ff0037'. The lock on the message has been lost"

On checking the logic app executions, I can see another attempt was made to process the same message with a DIFFERENT message lock ID, approximately 5 seconds after the first attempt encountered the gateway timeout (and hence the 2 logic app executions ran concurrently for a while). It appears that the original lock on the message was somehow abandoned, and the 2nd logic app picked it up from the service bus again.

Summary of some key data for the 2 attempts at processing the message in the image below - the service bus is configured with a lock period of 5 minutes, which I see reflected in the 'enqueued time' and 'locked until' values for the first attempt.

Any ideas? Thanks in advance.


concern about service bus cost

$
0
0

hello,

I create a standard tier service bus queue with sessions enabled

the way I send is from nodejs, something like this {body : themessage, brokerproperties : {SessionId : "my_session_d"}

to read the message, I created a service bus trigger azure function using nodejs. and it works when I added isSessionsEnabled : true.

What I am concerned about is the "brokered connection" cost. In my usage, will I get billed for "brokered connection" ?

any help is greatly appreciated

Azure Service Bus - Peek a scheduled message

$
0
0

Im am using Python to develop a integration that read messages from different Azure Service Bus topics and queues. But I have an issue when scheduling messages. I am not able to peek the scheduled messages. I want to peek them, and then either complete or leave them unread, until scheduled-time. I have tried to peek on both queue and topic, and I cannot find any documentation on how to peek a scheduled message on either of them, and then to subsequently either defer or dont do anything to the messages. Anyone managed to do this? Should be a very common use-case. Not found anything on doing it by standard REST-calls either.

Sporadic MessageLockLostException

$
0
0

Every once in a while (1 in thousands of messages) I am getting a MessageLockLostException when trying to complete a message.

I have a queue defined with lock duration set to 30s:

In code I create a listener with the following options:

var messageHandlerOptions = new MessageHandlerOptions(exceptionReceivedHandler)
{
   MaxConcurrentCalls = 10,
   AutoComplete = false,
   MaxAutoRenewDuration = TimeSpan.FromSeconds(180)
};

var queueClient = ResolveQueueClientByQueueConfigName(queueConfigName);

_logger.Info($"Listening on queue {queueClient.ServiceBusConnection.Endpoint}{queueClient.QueueName}");
queueClient.RegisterMessageHandler(MyMessageHandler, messageHandlerOptions);

And in MyMessageHandler I complete the message after successful processing:

private static async Task CompleteAsync(IReceiverClient queueClient, string lockToken)
{
   await queueClient.CompleteAsync(lockToken);
}

private async Task MyMessageHandler(Message message, CancellationToken cancellationToken)
{
   //Processing omitted
   await CompleteAsync(queueClient, message.SystemProperties.LockToken);        
}

Like I said, this works fine for most of the messages, but once in a while I get the following:

2020-03-27 10:31:01,004 [64] INFO Received message: MessageId:7da4f7ec-9e27-4951-83f5-7f29d8fc93a8 2020-03-27 10:31:01,005 [64] INFO Entity Framework Core "3.1.0" initialized '"SmsDataContext"' using provider '"Microsoft.EntityFrameworkCore.SqlServer"' with options: "None" 2020-03-27 10:31:01,087 [109] INFO Sending message to smssender, CorrelationId: 7da4f7ec-9e27-4951-83f5-7f29d8fc93a8, label: SmsSender 2020-03-27 10:31:05,205 [158] INFO Completing message '7da4f7ec-9e27-4951-83f5-7f29d8fc93a8'2020-03-27 10:31:05,206 [158] ERROR Message handler encountered an exception Microsoft.Azure.ServiceBus.MessageLockLostException: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue, or was received by a different receiver instance. at Microsoft.Azure.ServiceBus.Core.MessageReceiver.DisposeMessagesAsync(IEnumerable`1 lockTokens, Outcome outcome) at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout) at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout) at Microsoft.Azure.ServiceBus.Core.MessageReceiver.CompleteAsync(IEnumerable`1 lockTokens) at Bcp.AzureServiceBusHelper.ServiceBusClientHelper.CompleteAsync(String queueName, Message message) at Bcp.Sms.Validator.ServiceHost.HostedService.ProcessMessagesAsync(Message validatorMessage, CancellationToken token) in *** at Microsoft.Azure.ServiceBus.MessageReceivePump.MessageDispatchTask(Message message). Context: Endpoint= prdhybrid.servicebus.windows.net; Entity Path: smsrequestvalidation; Executing Action: UserCallback2020-03-27 10:31:30,949 [109] INFO Received message: MessageId:7da4f7ec-9e27-4951-83f5-7f29d8fc93a8

So in this case the lock was taken at 10:31:01 and the message complete failed 4 seconds later at 10:31:05, well within the 30 second lock duration.

The last log line indicates the message was retried after 30 seconds at 10:31:30 which tells me that the lock should have been valid at 10:31:05.

Could it be that the lock contained in message.SystemProperties.LockToken is corrupted? Also, could this be due to a short network interruption? I would imagine the LockToken stays valid in this case.

This application is written in .net core 3.1 using Microsoft.Azure.ServiceBus 4.1.2

Thanks in advance for the help!


Event Grid to Service Bus

$
0
0

Hi All, 

I am currently using Event Grid to route messages to several service bus queues. This is working fine however when I configure service bus as a Event Grid topic subscriber I would like to be able to set the message Id based on a value in the Event Grid message. In logic apps I have the ability to set the message Id when forwarding to different queues was just wondering if I could to the same and set the message id from EG topic to SB Topic

Thanks

Event grid for tracking the Azure Resource group tag changes

$
0
0

Hi,

I have scenario where I wanted to track the changes in Azure resource group tags using event grid.

Which are all the tags modified accordingly I wanted to take some action

How to do this?

If I have more than one subscription and more resource groups inside those subscriptions then How do I need to handle?

Thanks

Read a message from EventHub using SAS Token

$
0
0

Hi ,

I am currently using eventProcessorHost to read & send message to eventhub using connection string. It's working fine while using connection string (listen mode) but same code is not working while connecting with SAS token.

Steps  followed: created connecting string from sas token and then used the same code.

Error message:Failed to retrieve EventHub entities. Exception: System.UnauthorizedAccessException: The remote server returned an error: (401) Unauthorized. claim is empty.

Same SAS key working fine while accessing from rest call.

is there any way to read message from eventhub using rest api call? if so please assist me? 

is there any way to read a eventhub message using sas token and eventprocessorhost?

Thanks

Maha


How to subscribe topic of IBM MQ?

$
0
0

What option are available if I want to get data from MQ Topic (not queue) to Service Bus?

Authentication includes a certificate.


Kenny_I


To modify company name

$
0
0

Could you tell me how to modify company name in Microsoft Azure.

Note that my account is a free version.

Send message to Service Bus Topic using MSIAuthentication class with Python SDK

$
0
0

We would like to send messages to different Service Bus topics using the Python SDK from an Azure Function. We prefer not to use bindings as we will be deciding which topics to send data to dynamically and we would like to avoid using the service bus key for authentication.

In the following page:

Quickstart: Use Service Bus topics and subscriptions with Python

The following code is used to create an instance of the ServiceBusService class:

bus_service = ServiceBusService(
    service_namespace='<namespace>',
    shared_access_key_name='<sharedaccesskeyname>',
    shared_access_key_value='<sharedaccesskeyvalue>')

We would like to avoid having to plug in the Key value in there and instead use MSIAuthentication class from the msrestazure.azure_active_directory package. 

We tried using the authentication parameter in the ServiceBusService class with something like:

bus_service = ServiceBusService(
    service_namespace='ournamespace'
    authentication=MSIAuthentication())

Our Azure Function has a System Assigned Identity against it and we have tested that we can successfully perform various operations with this mode of authentication from our function.

However, when using the MSIAuthentication() with the ServiceBusService class, the SDK always errors with:

AttributeError: 'MSIAuthentication' object has no attribute 'sign_request'.

We have the same issue trying locally with the ServicePrincipalCredentials class.

How can we send messages to Service Bus topic with alternative ways of authenticating rather than using the Service Bus key?




DevOps CI/CD with Service Bus?

$
0
0

Any CI/CD tutorial or instruction for Service Bus?

How service bus configuration can be done when there is several person in organisation which needs to do configurations like creating new Topic and Subscription?


Kenny_I

Azure Service Bus - estimation of the number of brokered connection

$
0
0

Hello everyone!

I was trying to estimate no. of brokered connections while arrive at pricing for Service Bus (STANDARD TIER) for the following scenario:

  • There are 32 clients sending messages to/ receiving messages from a Service Bus queue through AMQP protocol.
  • Each client connects to the Service Bus several times in an hour, with duration of a single connection (including timeout) ~=1 minute

I understand from documentation that Microsoft charges based on the peak number of concurrent brokered connections

Microsoft charges for the peak number of concurrent brokered connections that exceed the included quantity (1,000 in the standard and premium tier).

Now for one month, what will be the no. of brokered connections?

  • is it 32? - as, at any given point of time, there areonly 32 peak live connections and based on the formula given in Pricing document. Therefore total connections being 32 connections * 24 hours per day * 30.5 days / 730 = 32
  • is it 1920? - as, in an hour,each client connects to Service Bus 60 times (no. of minutes in an hour [=60] / duration of a single connection [=1]). Therefore, total connections being (32 * 60) connections * 24 hours per day * 30,5 days / 730 = 1920.

Please help me understand how to calculate the no. of brokered connections in this scenario!

Thanks,

Lakshmi Kanthan.

Java service bus connection is throwing Caused by: com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=proton:io, description='javax.net.ssl.SSLHandshakeException: General SSLEngine problem', info=null}

$
0
0

Hi all,

The java service bus connection is throwing an ssl error:

Caused by: com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=proton:io, description='javax.net.ssl.SSLHandshakeException: General SSLEngine problem', info=null}

I have tried:

Installing the microsoft CAs into the cacerts store

Installing the baltimore cert into the cacerts tool

using the oracle 8 JDK and the zulu 8 and 11 JDKs

Any suggestions on which root CA to use or how to get by the error would be appreciated

Viewing all 1916 articles
Browse latest View live


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