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

Windows Service Bus 1.1 on premises is it compatible with VS 2017

$
0
0

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


Azure function takes time to send broked messages to queue

$
0
0

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 trigger
string queueMessageJson = JsonConvert.SerializeObject(objRequest);
var queueStream = new MemoryStream(Encoding.UTF8.GetBytes(queueMessageJson));
BrokeredMessage objBrokeredmsg = new BrokeredMessage(queueStream);
var queueToSendMessage = QueueClient.CreateFromConnectionString(servicebusconnectionstring, "queuename");
queueToSendMessage.RetryPolicy = new RetryExponential(minBackoff: TimeSpan.FromSeconds(0.1), maxBackoff: TimeSpan.FromSeconds(30), maxRetryCount: 20);
queueToSendMessage.Send(objBrokeredmsg);

Can anyone help what i'm doing wrong which takes time to send message to queue.

Azure function takes time to send brokered messages to service bus queue

$
0
0

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 trigger
string queueMessageJson = JsonConvert.SerializeObject(objRequest);
var queueStream = new MemoryStream(Encoding.UTF8.GetBytes(queueMessageJson));
BrokeredMessage objBrokeredmsg = new BrokeredMessage(queueStream);
var queueToSendMessage = QueueClient.CreateFromConnectionString(servicebusconnectionstring, "queuename");
queueToSendMessage.RetryPolicy = new RetryExponential(minBackoff: TimeSpan.FromSeconds(0.1), maxBackoff: TimeSpan.FromSeconds(30), maxRetryCount: 20);
queueToSendMessage.Send(objBrokeredmsg);

Can anyone help what i'm doing wrong which takes time to send message to queue.



EventHubTrigger Poblems

$
0
0

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>

Namespace not listed but error message states it exists

$
0
0

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.

Azure Subscription Configuration via REST

$
0
0

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.

Session based Filtering not happening in Receiver Azure Topic

$
0
0
I have been working on session enabled topic/subscription.

used following code to create Topic/Subscription,

   
 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);
            }




 While receiving message in Receiver, filtering based on sessionId is not happening. I have used following code in Receiver,

     
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);
        }

For example:
I am sending message with following sessionId

Scenario 1. sessionId = sessionId1    
Scenario 2. sessionId = sessionId2

Receiver:  
Suppose I need to get messages which has only sessionId1,But using the above method it's simply returning the top batch of record(it may be sessionId1 or sessionId2)

1. how to get the exact matched message which has same sessionId?
2. whether any other feature is there apart from sessionId to achieve the same?

Thanks in Advance.

Getting SessionCannotBeLockedException on retrieving message

$
0
0

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.


MessagingCommunicationException - Azure service bus

$
0
0

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)

How to enable RequiresSession Property in Subscription

$
0
0

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.

Need advice on dealing with DeadLetterQueues for Topic Subscriptions

$
0
0

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



SAS Shared access signature tokens w/Service Bus

$
0
0

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.

can you fill in the gaps in this service bus description?

$
0
0

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:

  • A service bus has topics
  • Topics have subscribers
  • When a message is added to a topic then this message gets pushed to subscribers

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?

Exception: The remote server returned an error: (400) Bad Request.. Method b__1

$
0
0

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.

FQDN in Azure Event Hub

$
0
0

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


Triggering Azure DevOps with a Service Bus Queue

$
0
0

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.

How to enable Azure Event Grid Webhook to Azure VM

$
0
0
We're using Azure Event Grid Webhooks (https://docs.microsoft.com/en-us/azure/event-grid/receive-events) with the endpoint configured as a server running in an azure virtual machine.

The VM is running with a security group that only enables known addresses. The problem is that the source of these events, (somewhere in Azure is not known. Therefore we currently have to disable the security group, sniff the source of the events, and <g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="10" id="10">reenable</g> the security group with allowing the source IP. Is there a better way to go about this then doing this for all possible sources? 

If not, is there a means of getting the source addresses of these events somehow?

Not able to list the hybrid relays inside a relay namespace using namespace connection string

$
0
0

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

Subscibing Azure Topics

$
0
0

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.

Azure Service bus MessageReceiver.ReceivAsync returns null

$
0
0

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?

Viewing all 1916 articles
Browse latest View live


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