HI
We are trying to use windows service bus 1.1 on premises with VS 2017 and .Net framework 4.7. Will it be a problem or we can use it ?
Thanks
Kokonad
HI
We are trying to use windows service bus 1.1 on premises with VS 2017 and .Net framework 4.7. Will it be a problem or we can use it ?
Thanks
Kokonad
Hi Team,
I have implemented ones simple functionality to send a brokered message to service bus queue, but when i am verifying the performance of my azure function maximum time takes in sending messages to queue. Can any one help me on this what im doing wrong while sending messages to service bus queue.
my code:
// objRequest is request recived from http triggerCan anyone help what i'm doing wrong which takes time to send message to queue.
Hi Team,
I have implemented ones simple functionality to send a brokered message to service bus queue, but when i am verifying the performance of my azure function maximum time takes in sending messages to queue. Can any one help me on this what im doing wrong while sending messages to service bus queue.
my code:
// objRequest is request recived from http triggerCan anyone help what i'm doing wrong which takes time to send message to queue.
Hello everyone,
after I followed the instructions on the following articles
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs
I have created an EventHubTrigger, which looks like this:
using System; public static void Run(string myEventHubMessage, ILogger log) { log.LogInformation($'C# Event Hub trigger function processed a message: {myEventHubMessage}'); }
This did work without any problems, but since I do need additional meta information, I changed the code to the following (described in the second linked article):
#r 'Microsoft.ServiceBus' using System.Text; using System; using Microsoft.ServiceBus.Messaging; public static void Run(EventData myEventHubMessage, ILogger log) { log.LogInformation($'EnqueuedTimeUtc={myEventHubMessage.EnqueuedTimeUtc}'); log.LogInformation($'SequenceNumber={myEventHubMessage.SequenceNumber}'); log.LogInformation($'Offset={myEventHubMessage.Offset}'); }
But this code results in the following error messages (btw I have also tied to use the deprected TraceWriter instead of ILogger to exactly follow the article but this results in the same error)
2018-10-11T14:22:24.814 [Error] run.csx(1,1): error CS0006: Metadata file 'Microsoft.ServiceBus' could not be found 2018-10-11T14:22:24.903 [Error] run.csx(4,17): error CS0234: The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
My question is now, does anyone have a clue what to do in order to get this small piece of code running?
Of course it has to have something to do with the assemblies but the aricle states, that when working in the online portal-editor, there are no further steps to do,.
Man thanks in advance
Felix
PS:
host.json :
{
"version": "2.0"
}
Content of extensions.csproj is:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<WarningsAsErrors />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.0.1" />
</ItemGroup>
</Project>
I am trying to create a Service Bus Namespace however I get an error stating that a namespace with that name already exists. No such namespace appears in the list however.
This may be because I originally tried to create the namespace with underscore (_) characters and this is not possible. I then replaced these with hypens (-) but decided to cancel before committing the create because I wanted to create a new Resource Group that used hypens rather than underscores for consistency. When I returned to create the Namespace, I found that it already exists. Since I can't see it in the list, I can't delete it. I have also tried through Powershell and this didn't work either.
Hello Everyone,
I am working in Application Integration and recently one of the requirement is to Subscribe to Azure Subscription / Topic Via DataStage.
I am trying to configure the REST API for the same, however I don't see any GET METHOD to retrieve the messages from subscription / topic.
I am looking for inputs of the REST configuration.
Thanks in Advance.
--Harini.
var subscriptionName = "TestSubscription"; var topicName = "MyPartitionTopic"; var namespaceManager = NamespaceManager.CreateFromConnectionString(RuntimeConfig.ConnectionStrings.PrimaryAzureSb); if (!namespaceManager.TopicExists(topicName)) { var td = new TopicDescription(topicName); td.EnablePartitioning = true; namespaceManager.CreateTopic(td); } if (!namespaceManager.SubscriptionExists(topicName, subscriptionName)) { var sd = new SubscriptionDescription(topicName, subscriptionName); sd.RequiresSession = true; namespaceManager.CreateSubscription(sd); }
void ReadMessage(string ConnectionStrings, string topicName, string subscriptionName, MessagingFactory messagingFactory, int batchcount) { int receivedMessages = 0; SubscriptionClient subsClient = messagingFactory.CreateSubscriptionClient(topicName, subscriptionName, ReceiveMode.ReceiveAndDelete); string sessionId = "sessionId1"; subsClient.AcceptMessageSession(sessionId); IEnumerable<BrokeredMessage> messages = subsClient.PeekBatch(batchcount); }
While performing receive operation using
var session = await subscriptionClient.AcceptMessageSessionAsync(sessionId);
in Topic/subscription SessionEnabled I am getting following execption "Microsoft.ServiceBus.Messaging.SessionCannotBeLockedException".
"ExceptionMessage": "The requested session 'sessionID' cannot be accepted. It may be locked by another receiver.
How should I handle the above exception?
Thanks in Advance.
Quite frequently i see below errors in log files, are these not internally handled by service bus and retry ?. These doesn't seem to be timeout error and according to information from MSDN retry policy is applicable only for transient errors , is below error
classified as transient error
Exception: Microsoft.ServiceBus.Messaging.MessagingCommunicationException: Error during communication with Service Bus. Check the connection information, then retry. ---> System.ServiceModel.CommunicationObjectFaultedException: Internal Server Error:
The server did not provide a meaningful reply; this might be caused by a premature session shutdown..TrackingId:urn:uuid:e5749ef1-9ad3-4543-a420-14dfebaae4c4, Timestamp:3/30/2015 10:37:28 PM
Server stack trace:
Exception rethrown at [0]:
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(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 [1]:
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
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.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.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
Exception rethrown at [4]:
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnEndClose(IAsyncResult result)
--- End of inner exception stack trace ---
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Messaging.TopicClient.OnEndClose(IAsyncResult result)
at Microsoft.ServiceBus.Messaging.MessageClientEntity.Close(TimeSpan timeout)
at Canon.PhotoModel.Infrastructure.ServiceBus.ServiceBusRepository.SendMessage[T](T eventObject, BrokeredMessage message)
I have topics and subscription already been created in production.Now I have to enable RequiresSession for the existing Subscription without losing the data. But it is allowing to set the property while creating.
How can I enable RequiresSession for a subscription either by coding or via Azure Portal or by any other appraoch without losing any data in production?
any suggestion please
Thanks in advance.
I have a question about suggested strategies for dealing with Dead letter queues for Topic subscriptions. The situation we have is this:
Our service has a Subscription to a Topic that another team owns and is publishing too. For that reason, our service has Listen permissions for the Topic (i.e. not Send)
We have "Max Delivery Count" for our Subscription set to 10. What we observe is that after ten failed attempts to process a message, that message goes to the DeadLetterQueue(DLQ) for our Subscription. All as expected.
We now want to have a mechanism where we can attempt to re-process the messages on the DLQ, and we are trying to figure out the best strategy for doing so.
Our initial naive thought(I'll call it "Option A") was to pull the messages from the DLQ, read the values of the message, and then create and publish a new Message to the Topic(and remove that message from the DLQ). However, this is problematic
for a couple of reasons:
1) We don't have Send permissions to the Topic, so we can't do that right now
2) Even if we could get Send permissions, if we re-published a message to the Topic as a whole, every Subscriber to that topic would have to see and deal with that re-published messages. This seems inefficient and problematic. (And yes, we do
understand that due to the nature of things, all services do need to be able to handle duplicate messages anyway, but still feels wrong)
We are brainstorming several other options, but I'm curious if Microsoft or others have recommendations or experience dealing with this scenario and could give thoughts and advice.
Thanks
Mike
Azure storage has the ability to click a button and generate SAS keys for storage accounts, however the portal does not have that same ability on the service bus. Is this even possible to do, outside of developing an application?
I have this link, which looks like maybe this is possible but requires some c# coding development. https://code.msdn.microsoft.com/Shared-Access-Signature-0a88adf8 and https://code.msdn.microsoft.com/Using-Shared-Access-e605b37c
If anyone knows of a way to do this using the portal or powershell, please advise.
I'm new to service buses and trying to get a better understanding of the details. Consider the following statement:
"If the max delivery count for a message is exceeded for a subscription then the messaging system places the message on the dead letter sub queue"
Please confirm if my following understanding is correct:
Can you explain the concept of "max delivery count" in this context? Can you name a specific object type in Azure which attempts to deliver this message? I'm guessing that a failed delivery means that the subscriber is offline or is in some state where it doesn't receive the message or rejects the message? Is this correct?
If the service bus encounters an internal error when attempting to deliver the message then I'm assuming that this would not count towards the "max delivery count" number, right? Can you generically describe the process in which the bus attempts to send the message to the subscriber but delivery fails? What are the common response types to this send attempt which would increment the failed delivery count number? Also, can you describe the process for accessing the dead letter subqueue in Azure?
Hi All,
when I am trying to send a message to a topic from service bus explorer 4.0.110, I am getting "Exception: The remote server returned an error: (400) Bad Request.. Method <SendMessages>b__1" error. I don't know what to do.
Please help me if someone can help.
Thank you.
Hi,
I have a kafka producer code which i'm now trying to send same events to Event hub. For that it asks for Event Hub FQDN. Please see the config snippet below.
bootstrap.servers={YOUR.EVENTHUBS.FQDN}:9093 security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}"
what is EVENTHUBS FQDN here?
Is it sb://<evethubs_namespace_name>.servicebus.windows.net:9093 ?? Or
Is it something different ?
I tried the above URL but its not connecting to Event Hub. Could some one help me with this?
Thanks.
Nihar
I have a CMS which powers my Static Website, currently I can build my website each time I make a checkin via source control, however I cannot see my changes when I make CMS changes.
I hada solution!
1. Make CMS change
2. Prismic CMS sends webhook trigger to Azure Functions
3. Azure functions parses webhook and creates as many builds as the webhook describes which are represented by service bus messages.
4. Service bus is read by Azure Devops and re-pushes changes!
Unfortunately I cannot get step 4 to work :( Is there any way to trigger an Azure Pipeline so I can run my build and release?
Cheers!
Michael.
I am trying to list the hybrid relays inside a relay namespace.
I have tried using
NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
var _azureRelays = await namespaceManager.GetRelaysAsync();
which lists only WCF relays and
RelayManager
and RelayManagementClient
to
list out the hybrid relays, but both these client requires resource group name and namespace name.
Are there any clients which is used to list the hybrid relays using connection string alone?
Balasubramaniam_Murugesan
Hi,
I have a Azure Servicebus Topic, which have multipleSubscriptions. I need to subscribe the Topic subscriptions in a Windows Service. Can I know how this can be done.
I have an azure function that is triggered every 1 minute. The function creates a MessageReceiver like this
var messageReceiver = new MessageReceiver(serviceBusConnectionString, entityPath, ReceiveMode.PeekLock, null, 0);
The subscription has a lock duration of 1 minute. It then tries to fetch up to 100 messages from the subscription like this:
var allMessages = new List<Message>(); Message message; do { message = await messageReceiver.ReceiveAsync(TimeSpan.FromSeconds(5)); if (message != null) allMessages.Add(message); } while (message != null && allMessages.Count() < 100);
After processing the messages are completed using messageReceiver.CompleteAsync
and
the messageReceiver is closed using messageReceiver.CloseAsync()
.
The first time the function runs it fetches up to several messages from the subscription, but on the next runs it often only fetches 0 or 1 message no matter the number of messages available in the subscription (Service Bus Explorer shows that there > 10 messages in the subscription). So it seems that ReceiveAsync returns null even when there is messages available.
Increasing the timeout for ReceiveAsync doesn't seem to help.
Why does ReceiveAsync return null when there is messages available?