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

How to use peeklock/delete pattern to handle messages in event hub?

$
0
0

Hi,

I have a consumer group with multiple consumers. If one consumer failed to process the message (by some internal reasons. not poison), I want it just leave that message and let other consumers have chance to process it again. previous I use service bus queue/topic, the peeklock/delete pattern with the dead-letter queue can easily achieve this. Now by some reason I switch event hub,

Is there still some way to achieve this? what is the recommended way to handle this in event hub?

thanks!

Robin

 


Which Windows Service to list as dependency?

$
0
0

I have a Windows Service that uses Service Bus, and would like to add the appropriate service bus service as a dependency so that it starts after service bus is ready to receive connections. Which of the Windows services do I need to state a dependency on? There are four listed:

Service Bus Gateway

Service Bus Message Broker

Service Bus Resource Provider

Service Bus VSS

How to set the Throughout Unit for Azure Service bus?

$
0
0
From the guideline " The Throughput Units value that is set on a Service Bus namespace determines the actual throughput allowed". so how to set the Throughout Unit for Azure Service bus?

Test connectivity of service bus to my on premise servers

$
0
0

Hi there,

I am getting the following error from my on premise servers while connecting to azure service bus. I would like to know is there a tool or way available to check network connectivity between azure service bus to my on premise server?

LogEntry.Message = Caught exception while starting BusAdapter System.TimeoutException: The request has timed out after 15000 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded..TrackingId:ab3583ac-9167-4c3a-86c9-58638e970f9d,TimeStamp:4/27/2015 10:34:42 PM ---> System.Net.WebException: The request was aborted: The request was canceled.

   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.GetAsyncResult`1.<GetAsyncSteps>b__2d(GetAsyncResult`1 thisPtr, IAsyncResult r)

   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

   --- End of inner exception stack trace ---

Server stack trace:

Exception rethrown at [0]:

   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)

   at Microsoft.ServiceBus.NamespaceManager.OnEndSubscriptionExists(IAsyncResult result)

   at Microsoft.ServiceBus.NamespaceManager.SubscriptionExists(String topicPath, String name)

Evenhub send access through JavaScript

$
0
0

Hi,

I have a requirement to send messages to Eventhub from Javascript client. Is there any pointer or sample which does this?

TimeOut while creating subscription in Service bus namespace

$
0
0

Hi Team

I have been using Azure topic and subscription in my application, i do see on regular basis timeout error from Azure. This is snippet of code which i uses. THis typically happens when there is inactivity at the service bus namespace i.e. no request or communication happens with service bus for a long period of time

                           

    if (!namespaceManager.TopicExists(topicName))
            {
                TopicDescription topicMetaData = new TopicDescription(topicName);
                topicMetaData.MaxSizeInMegabytes = 5120;
                topicMetaData.DefaultMessageTimeToLive = TimeSpan.FromDays(topicTTLInDays);
                namespaceManager.CreateTopic(topicMetaData);
            }

            //Create the Subscription with Filter
            if (!namespaceManager.SubscriptionExists(topicName, subscriptionName))
            {

                RuleDescription ruleMetaData = new RuleDescription();
                ruleMetaData.Name = "SubscriptionRule";
                ruleMetaData.Filter = new SqlFilter(filterExpression);

                namespaceManager.CreateSubscription(topicName, subscriptionName, ruleMetaData);
            }
            else
            {
                IEnumerable<RuleDescription> rules = namespaceManager.GetRules(topicName, subscriptionName);
                foreach (RuleDescription rule in rules)
                {
                    if (rule.Name == "SubscriptionRule")
                    {
                        SubscriptionClient client = SubscriptionClient.CreateFromConnectionString(sbConnectionString, topicName, subscriptionName);
                        client.RemoveRule("SubscriptionRule");
                        RuleDescription ruleMetaData = new RuleDescription();
                        ruleMetaData.Name = "SubscriptionRule";
                        ruleMetaData.Filter = new SqlFilter(filterExpression);
                        client.AddRule(ruleMetaData);

                    }

                }

Error information is:

Exception Information Details:
======================================
Exception Type: System.TimeoutException
Message: The request has timed out after 60000 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded.
Target Site: TAsyncResult End[TAsyncResult](System.IAsyncResult)
Help Link: 
Source: Microsoft.ServiceBus

Stack Trace Information Details: 
======================================

Server stack trace: 


Exception rethrown at [0]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.NamespaceManager.OnEndSubscriptionExists(IAsyncResult result)
   at Microsoft.ServiceBus.NamespaceManager.SubscriptionExists(String topicPath, String name)

Exception Information Details:
======================================
Exception Type: System.Net.WebException
Status: RequestCanceled
Response: 
Message: The request was aborted: The request was canceled.
Target Site: System.Net.WebResponse EndGetResponse(System.IAsyncResult)
Help Link: 
Source: System

Thanks

Deepak Sanghi


Deepak Sanghi Happy Biztalking.........

Azure Service Bus Queue usage clarification

$
0
0

I am getting data from 50 different clients every minute 50*1440*31 = 2232000.I need the data to be processed and updated real-time.Each client data to be processed synchronously.All the components i am using is Azure like (Web, DB, Services)

So initially i am doing processing once i get the message and respond back to client.Due to delay in the processing on server.Client response is getting delayed.So i looked for 3 options to give immediate response.

a) Using Service Bus Queue.
b) Running using Parallel Processing (Task.StartNew()).
c) Store the Message and Process it later using worker role continuously.

So i started using Service Bus Queue.

I added one queue and try to load all the 50 clients data into one then process it from queue using Azure Worker role.Then queue length is getting increasing due to delay in processing of message for each client.Each msg processing is taking some where around 15sec.But i need the data to be processed real-time with in that minute the message receives.

So i added separate queue for each client to load the message specific to the client.By using azure worker role i am processing the messages from these 50 queues using 50 queue clients and try to process the messages like as shown below

public override void Run()
    {
        Trace.WriteLine("Starting processing of messages");

        OnMessageOptions options = new OnMessageOptions();
        options.AutoComplete = true;
        options.MaxConcurrentCalls = 1;
        options.ExceptionReceived += LogErrors;

        _client1.OnMessage((receivedMessage) =>
        {
            ProcessMessage(receivedMessage);
        }, options);

        _client2.OnMessage((receivedMessage) =>
        {
            ProcessMessage(receivedMessage);
        }, options);
        .
        .
        .
        _client50.OnMessage((receivedMessage) =>
        {
            ProcessMessage(receivedMessage);
        }, options);

        CompletedEvent.WaitOne();
    }

    public override bool OnStart()
    {
        // Set the maximum number of concurrent connections
        ServicePointManager.DefaultConnectionLimit = 12;

        // Create the queue if it does not exist already
        string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
        var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
        if (!namespaceManager.QueueExists(QueueName1))
        {
            namespaceManager.CreateQueue(QueueName1);
        }
        if (!namespaceManager.QueueExists(QueueName2))
        {
            namespaceManager.CreateQueue(QueueName2);
        }
        .
        .
        if (!namespaceManager.QueueExists(QueueName50))
        {
            namespaceManager.CreateQueue(QueueName50);
        }

        _client1 = QueueClient.CreateFromConnectionString(connectionString, QueueName1);
        _client2 = QueueClient.CreateFromConnectionString(connectionString, QueueName2);
        .
        .
        _client50 = QueueClient.CreateFromConnectionString(connectionString, QueueName50);
        return base.OnStart();
    }

    public override void OnStop()
    {
        // Close the connection to Service Bus Queue
        _client1.Close();
        _client2.Close();
        .
        .
        _client50.Close();
        CompletedEvent.Set();
        base.OnStop();
    }

Clarifications required:

a) Is the above code works parallel execution of data from multiple clients?If not please let me know what needs to change in code

b) Is this the best way to process the message from 50 queue clients with in that minute?

c) For real-time data processing is it better to use queues in Azure Service Bus or any other options we can use in Azure?

d) One more thing need clarification is how the Azure Usage costs for this intermediate layer added as Service Bus Queue for 50 Queues for the total number of Messages and the Worker role calls for every minute for a monthly transactions around 50*1440*31 = 2232000.If the monthly costs are not more than $100 per month for message storing and message processing using worker role as above we can look for retaining this option of Service Bus Queue.Other wise i need to look for other options in Azure to process it for cost optimizations.I did not get very clear on Service Bus Brokered Connection and costs on Azure Website.That why i am asking about it.

e) How reliable this Azure Service Bus Queue.Once we added all data to be Service Bus Queue.This component needs to be available all time during the day for whole year.This will be critical component for us.If this Service Bus Queue is down for some reason then whole system is down.Such a mission critical.Is it good to use Service Bus Queue for this kind of scenarios?

f)Is there any thing we need to do to make the Service Bus Queue up all the time for the whole year.Is there a way we can get notification email if the service bus queue goes down.To handle processing in different manner.

Please suggest some one from Azure Team or people who is using Azure in these kind of scenarios in their applications.

Thanks in advance

Azure ServiceBus not accessible on portal

$
0
0

When I log in to azure portal, the category link on the left which shows Service bus has an exclamation mark with pink background which on hover shows "The portal can not load the management data for this resource type". Also when I try to create a new service and select App Services it shows service bus disabled with 'not available' in pink written below it.

Would appreciate any help to solve this..

Thanks

Arnab


Consuming Service Bus Relay in Windows Store App

$
0
0

Hello,

I've setup a WCF endpoint on Azure Service Bus with basicHttpRelayBinding. I understand Windows store apps can consume this WCF endpoint.

I am having a hard time finding instructions on how to build the client in my Windows Store app. Can anyone point me in the right direction?

I have tried to use https://msdn.microsoft.com/en-us/library/hh556233(v=vs.110).aspx but I don't see that the Relay binding is available in the WinRt System.ServiceModel namespace.

Thanks,


J Donnelly

Creating A Service Bus SAS Token and Consuming Relay in WinRT

$
0
0

I have a Service Bus Relay (WCF SOAP) I want to consume in my Windows Store App. I have written the code to create a token as well as the client which is below.

The problem is that I get an AuthorizationFailedFault returned with a faultstring "InvalidSignature: The token has an invalid signature." And I can't figure it out.

My Create Token method:

private static string CreateSasToken()
{
    TimeSpan sinceEpoch = DateTime.UtcNow - new DateTime(1970,1, 1);
    var expiry = Convert.ToString((int)sinceEpoch.TotalSeconds + 3600);
    string stringToSign = webUtility.UrlEncode(ServiceUri.AbsoluteUri) + "\n" + expiry;

    string hashKey = Encoding.UTF8.GetBytes(Secret).ToString();

    MacAlgorithmProvider macAlgorithmProvider = MacAlgorithmProvider.OpenAlgorithm(MacAlgorithmNames.HmacSha256);
    BinaryStringEncoding encoding = BinaryStringEncoding.Utf8;

    var messageBuffer = CryptographicBuffer.ConvertStringToBinary(stringToSign,encoding);
    IBuffer keyBuffer = CryptographicBuffer.ConvertStringToBinary(hashKey,encoding);

    CryptographicKey hmacKey = macAlgorithmProvider.CreateKey(keyBuffer);
    IBuffer signedMessage = CryptographicEngine.Sign(hmacKey, messageBuffer);

    string signature = CryptographicBuffer.EncodeToBase64String(signedMessage);

    var sasToken = String.Format(CultureInfo.InvariantCulture,
        "SharedAccessSignature sr={0}&sig={1}&se={2}&skn={3}",
        WebUtility.UrlEncode(ServiceUri.AbsoluteUri),
        WebUtility.UrlEncode(signature), expiry, Issuer);

    return sasToken;
}

My Client class:

   public partial class ServiceClient
    {
        public async Task<string> GetDataUsingDataContract(string item, string sasToken)
        {

            HttpClient client = new HttpClient();

            client.DefaultRequestHeaders.Add("ServiceBusAuthorization",sasToken);
            client.DefaultRequestHeaders.Add("SOAPAction",".../GetDataUsingDataContract");
            client.DefaultRequestHeaders.Add("Host", "xxxxxxxxxxx.servicebus.windows.net");

            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post,ServiceUri);

            var content =new StringContent(@"<s:Envelope
                xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Header></s:Header><s:Body>"+ item +@"</s:Body></s:Envelope>",System.Text.Encoding.UTF8,"application/xml");
            request.Content = content;

            HttpResponseMessage wcfResponse = client.SendAsync(request).Result;
            HttpContent stream = wcfResponse.Content;

            var response = stream.ReadAsStringAsync();
            var returnPacket = response.Result;

            return returnPacket;
        }
    }
I have been successful consuming the Relay using Http (via Fiddler) by copying an unexpired token created by Micorosft.ServiceBus in a console app.


John Donnelly

Service Bus 1.1 Always On Installation

$
0
0

Hi,

The documentation on how to setup Service Bus with Always On Availability Groups is rather sparse.

The documentation I have found explains the setup with very few lines:

"Using the cmdlets, pass the necessary connection string to New-SBFarmAdd-SBHost, and New-SBMessageContainer."

Source: https://msdn.microsoft.com/en-us/library/jj712784.aspx#BMK_SBConfig17

My assumptions of what needs to be performed are:

  1. Create an installation
  2. Then stop the service bus nodes
  3. Create an availability group of the databases
  4. Change Service Bus connection string to use the availability group listener according to the steps here: https://msdn.microsoft.com/en-us/library/jj712784.aspx#BMK_SBConfig6

Is there any more complete documentation about this and/or are my assumptions correct?

Regards,

//Thomas

Service bus Namespace certificate expire

$
0
0

Hi

A year ago we created a service bus namespace to run ACS which we use as a federation broker between our on-premise ADFS and Yahoo.

Azure generated a self-signed certificate that ACS use for token signing.

This certificate had a validity period of one year so it expired recently.

I found no way to renew/replace the certificate in Azure nor in ACS management portal.

Certificates and services tab in ACS management portal says "Service Namespace certificates and keys are automatically managed for this namespace".Since there seem to be no way to manually manage certificates for a service bus namespace in GUI or by powershell I saw a slight chance that Azure would renew this automatically.

However, it did not and the service went down.

1) Why does the GUI say namespace certificates are managed automatically when they are not?

2) Is there a way to manage these certificates?

3) Should I use an Active Directory namespace instead of a service bus namespace to contain ACS? If so why?

Regards

Stefan

Service Bus 2.6.6 Paired Namespace Enable Syphon

$
0
0

How to make work Paired Namespace receiver side to move messages from backlog queue to the primary queue. It seems to work with senders but with the receivers setting EnableSyphon = true does not seems to work. I can see always messages in the backlog queue and growing. All information that I could found is this Code Block , but since Service Bus 2.4Messaging.Factory does not have a Open Method.

factory = MessagingFactory.Create(SB_Primary_NS_Address);
factory.PairNamespace(new SendAvailabilityPairedNamespaceOptions
    {
        EnableSyphon = true,
        TransferQueueCount = 10,
        MessagingFactory = paired-NS_factory,
        NamespaceManager = paired-NS_manager
    });
factory.Open();

The endpoint was not found. Name not registered: sb://servicebusex.servicebus.windows.net/solver/.

$
0
0

Hello team,

I am using console based application for client which is accessing the another console based WCF service application via Service Bus Relay messaging. In my application, I am using netTCPRelayBinding.

But when I run the service, I am getting error like  "The endpoint was not found. Name not registered: sb://servicebusex.servicebus.windows.net/solver/. TrackingId:abe0a241-3125-4a82-bcfc-7a66a4d17e78_G16,TimeStamp:5/5/2015 1:21:01 PM. Please ensure that you can connect to the internet using HTTP port 80 and TCP port 9350."

Note that my firewall is disabled. try to access the same port via another TCP/IP based application, the mentioned ports are accessible.

Can someone help me to resolve this issue?


BhavinModi


How to repeatedly receive the same EventData from event hub?

$
0
0

Hi, 

I have several worker roles which receives dataEvent from a specific EventHub. When it received event data, it forwards these events to some infrastructure services to process them. Problem is these infrastructure services is not so trustable, they might be unavailable for a moment. If this happen, these event data will failed to be processed.

My Idea is if I find some infrastructure services are  unavailable, just let the event hub receiver stop receiving new message and repeating receive the current message.

Here the questing is:

  1. Is this doable? How to achieve this in code?
  2. When I  repeating the fault messages, will the fault messages always be received by the same worker role instance? 

Thanks.

Best wishes,

Robin



Service Bus and Portable Class Library

$
0
0

Hi all,

I was wondering if there already is a PCL regarding Azure operations like service bus topic/subscriptions, eventhub and so on. I need it for my Windows 10 IoT Core demo. Want to write an Universal App that sends messages to a topic and an eventhub and receives messages from a subscription.

I don't feel like writing my own PCL wrapper on top of Azure REST API :-(

regards

Riccardo

Unit testing MessageReceiver

$
0
0

Why is the Service Bus code (specifically, ServiceBus.v1_1 package) have classes and interfaces that cannot be overridden for unit testing?  A big blocker for me is not being able to create a fake version of MessageReceiver; because I cannot derive from this class due to internal constructor, and I cannot implement my own class with the interface for IMessageReceiver because the interface is marked internal.

Does no one unit test code related to this?  Or do they use some mocking framework (equivalent to shims in MS Fakes)?  Why aren't these interfaces just public??


Bert Jackson

The request to the service bus was blocked and didn't return in next 3 minutes.

$
0
0

Hi,

We have a web page which consumes messages from a service bus queue by the Rest APIs via Ajax. We have met this issue several times: the request is sent to service bus URL, after more than 3 minutes, no any response received. Just seems like the service is blocked. Then if we refresh the page, every thing become OK again. 

We cannot regularly reproduce it, we see it several time, below is the screen shoot we catched. Is it a bug?




What is best solution to process messages from Service Bus Queue, Azure?

$
0
0

Hi there,

I create TCP service to receive data from electronic device but as there can 2500-3000 devices at a time can interact with my TCP service so I want to put those messages in queue for further process. I have to deploy my solution on Microsoft azure platform and I see two options Azure Queue and Service Bus Queue. I think best solution for me is Service Bus Queue as no. of device can go beyond ~5000+ in future.

Now my concern is how I should process these messages from queue on azure what will be the best solution for that. In my earlier project, we implement WCF service on MSMQ binding to read message from queue and which was very successful with huge traffic. But now it is Azure platform so can you please suggest what the best solution is for that fromperformance and and security point of view.

Ankush


only one instance per role (at a time) is receiving messages from the same topic subscription

$
0
0

I have 2 worker roles: one sending messages to a topic and another role subscribing to all messages for the topic and I was expecting all instances of the subscriber role to receive all the messages sent by the first worker role. What I am seeing is a  message sent is either received by instance 0 or instance 1 (of the subscriber worker role) but not received by both.

Is my understanding of how topics work wrong? Since all the instances of the second role have valid subscriptions for the topic, I was thinking each message would be received by both instances of the subscriber role. Interestingly, I have read posts asking for this behavior I am observing and complaining that all the instances are receiving each message.

Viewing all 1916 articles
Browse latest View live


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