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

Service Bus subscription creation

$
0
0

Failed creating Service Bus subscription "NAME" with error code: InternalServerError and with message: CorrelationId: 49f92880-ed43-49e1-88c5-c839b8536f84.

Since two days I'm got this error. What's going on?

CODE:

 if (await manager.TopicExistsAsync(sb.TopicPath))
{
   if (!await manager.SubscriptionExistsAsync(sb.TopicPath, sb.Name))                        {
                            await manager.CreateSubscriptionAsync(sb);
                        }
}


Thanks


Reliable Communication from On-Prem .NET services to Azure Service Bus

$
0
0

Hi,

We have a number of Azure WebJobs that integrate with on-prem apps using Service Bus in a store-and-forward scenario. The overall architecture is that we receive HTTP messages that come in from the Internet through API Management, straight to Service Bus Queues, and then the WebJobs forward them to .NET Core APIs running on prem (again, going through API Management). That's great, because Azure Service Bus is reliable by its very nature; if our WebJob can't talk to the on-prem API for whatever reason, we just release the peek lock, and try again in 10 minutes until it succeeds. 

My question is...what is the prescribed guidance for reliable messaging going the other way i.e. from on-prem to Service Bus? I'm considering things like "the network is down", or Service Bus itself is offline (yes, it can happen). And yes, I realize I could use MSMQ and then a Windows Service to call Service Bus, but is there a better way suggested way for this "first-mile" part of an on-prem to Azure integration? 

Thanks!

PBR

Service Bus Topic To Azure SQL table

$
0
0
can I move messages from service bus topic to azure sql table

Outofmemory DownloadText() downloading Blob

$
0
0

with this code:

CloudBlockBlob blockBlob = syncMsgContainer.GetBlockBlobReference(blobId);                return blockBlob.DownloadText();

We get this error intermittently. Is there any suggestions on how to best troubleshoot this? We have a Blob that is about 80MB.

'Insert'  Base Exception:  Type: System.OutOfMemoryException  Assembly: System.OutOfMemoryException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  Source: mscorlib  Message: Exception of type 'System.OutOfMemoryException' was thrown.  StackTrace:    at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)     at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadText(Encoding encoding, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)     at Common.Azure.BlobContainerWrapper.DownloadBlob(String blobId)     at DbSyncService.Components.MessageProcessor.GenerateDMLInsertStatement(TableDataChanges change, Dictionary`2 columnTypes)     at DbSyncService.Components.MessageProcessor.ApplyDMLTableDataChange(TableDataChanges change, Guid srcLocationId)     at DbSyncService.Components.MessageProcessor.ProcessDataDMLMessage(IncomingBusMessage msg, Guid srcLocationId)  TargetSite: GetString      

Read event hub captured Data

$
0
0

Hello,

I am trying to read the data from captured event hub streaming data using spark. but couldn't able to do that.

after selecting the field which i need by using the following query

incomingStream.withColumn("Body", $"body".cast(StringType)).select("body")

Now i want to use this as body as input to spark.read.json(body)

Thanks

Naveen

Azure Event Hub - Unable to open authentication session on connection while sending data

$
0
0

Hi,

I was trying to send data to my azure event hub using python code sample provided in the tutorial. 


import logging
import time
from azure.eventhub import EventHubClient, EventData

logger = logging.getLogger("azure")


ADDRESS = "amqps://myeventhubnamespace.servicebus.windows.net/myeventhubname"
USER = "RootManageSharedAccessKey"
KEY = "mykey******"

try:
if not ADDRESS:
raise ValueError("amqps://myeventhubnamespace.servicebus.windows.net/myeventhubname")

client = EventHubClient(ADDRESS, debug=False, username=USER, password=KEY)
sender = client.add_sender(partition="0")
client.run()
try:
start_time = time.time()
for i in range(100):
print("Sending message: {}".format(i))
sender.send(EventData(str(i)))
except:
raise
finally:
end_time = time.time()
client.stop()
run_time = end_time - start_time
logger.info("Runtime: {} seconds".format(run_time))

except KeyboardInterrupt:
pass
All clients failed to start.
Traceback (most recent call last):
  File AzureEventHubSender.py", line 21, in <module>
    client.run()
  File "client.py", line 322, in run
    raise failed[0]
azure.eventhub.common.EventHubError: Unable to open authentication session on connection b'EHSender-be4839bc-f170-4ef7-9516-341449c5e1aa-partition0'.
Please confirm target hostname exists: b'nmeventhubwestus.servicebus.windows.net'

Process finished with exit code 1

as suggested on different post I opened port 5672, 5671 and 433 outbound on my machine and it still gives same error. 

Unable to send message to Service Bus Queue

$
0
0

Hi,

I am following the below MS link to create my first client application that could send messages to Service Bus Queue. I am a beginner to start using Service Bus.

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-get-started-with-queues

I have followed the instructions as specified above and I am using VS 2019 and Microsoft.Azure.ServiceBus to create my client application. When I run my console application I get the below error, which I think is a firewall issue as I am running it from my work station.

Exception: No connection could be made because the target machine actively refused it ErrorCode

While googling I found the below link which says, the connection to the Service bus queue is via TCP port 5671/5672.

https://serverfault.com/questions/918615/message-could-not-be-send-to-a-azure-cloud-message-queue 

Can someone suggest if that's true, then I will ask our network team to open these two ports on the Firewall. If you have any other suggestions then please let me know.

Regards

Biranchi


AcceptMessageSession - serverWaitTime What is this?

$
0
0

Hi,

I am developing code to send messages and receive responses via service bus. Messages and responses are paired via a SesionID.

I am trying to understand the various timeouts that are available

My code (first draft) looks like this:

        public async Task<TResponse> SendMessageAsync(TMessage message)
        {
            // send request message
            var msg = CreateRequestMessage(message);
            _requestClient.SendAsync(msg);

            var receiver = await _responseClient.AcceptMessageSessionAsync(msg.ReplyToSessionId, TimeSpan.FromMilliseconds(TimeoutMs)).ConfigureAwait(false);
            try
            {
                // receive response message
                BrokeredMessage receivedMessage = await
                    receiver.ReceiveAsync(TimeSpan.FromMilliseconds(TimeoutMs)).ConfigureAwait(false);
                if (receivedMessage != null)
                {
                    var body = receivedMessage.GetBody<Stream>();
                    return _serializer.DeserializeObject<TResponse>(new StreamReader(body, true).ReadToEnd());
                }
                else
                {
                    throw new TimeoutException();
                }
            }
            finally
            {
                receiver.Close();
            }
        }

I am testing all my assumptions within the code and am trying to figure out the effect of the serverWaitTime parameter within the AcceptMessageSessionAsync call.

I cant figure it out and the docs are unclear (at least to me ;-). Whatever the value (even TimeSpan.FromTicks(1)) the call returns a MessageSession immediately. No nulls, no TimeoutException.

Only the serverWaitTime on ReceiveAsync seems to make a difference.

Am I missing something? Can someone please explain the serverWaitTime parameter in the AcceptMessageSessionAsync method.

Thanks,

M


Azure Service Bus Topic Receiving messages

$
0
0

Referring to https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/GettingStarted/Microsoft.Azure.ServiceBus/BasicSendReceiveUsingTopicSubscriptionClient, I understand how Azure Service Bus Topics work in general, my question is more about how it actually works.

When a MesageHandler is registered (subscriptionClient.RegisterMessageHandler), it starts receiving messages as I see in

Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}");

However, my question is whether the client actually receives the messages using a pull mode or it is a push from the Service Bus? Is there a continuous polling done by the Client to receive the messages - how does this work internally?

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!

Creating filters for Subscription in a Azure Service Bus(Topics)

$
0
0

Hi,

Is there a way to create filters for Subscription in a Azure Service Bus(Topics) using 'Azure Management Portal'.

I am a beginner in using 'Azure Management Portal'.

/Biranchi

Problem with Azure service bus policy alias

$
0
0

Hi All,

I am trying to audit if the partition is enabled or not using azure policy. But it is not listing the resources either in compliance or Non-compliance.

Policy Rule :

"policyRule": {"if": {"allOf": [
        {"field": "type","equals": "Microsoft.ServiceBus/namespaces/topics"
        },
        {"anyOf": [
            {"field": "Microsoft.ServiceBus/namespaces/topics/enablePartitioning","exists": "false"
            },
            {"field": "Microsoft.ServiceBus/namespaces/topics/enablePartitioning","equals": "false"
            }
          ]
        }
      ]
    },"then": {"effect": "audit"
    }
  }

The remote server returned an error: (401) Unauthorized. claim is empty when connect with service bus topic connection string in service bus explorer

$
0
0

Hi Team,

   I try to connect service bus topic connection string in service bus explorer.(ServiceBusExplorer-4.0.109) and i am getting below exception.  

Exception: The remote server returned an error: (401) Unauthorized. claim is empty. TrackingId:691fcdf2-5a41-4365-b8e1-91cf29b9ba6a_G10

1. Can we connect the service topic connection string in Service bus explorer? 

2. If not is any possibility there to check the topic connection string valid or not?

Note: when i connect service bus Rootmanager connection string, i can be able to successfully connect and i can be able to view the topics details.

Kindly provide your answer.

Thanks

Udayakumar S

Data Engineer

$
0
0

Hi Below is my Scenario:

We have a Azure stream analytics that streams messages into the Azure service Bus via pub-sub in the clients environment.

Our project demands us to move that data from the azure service bus in an on premise mssql database in our in house environment.

> We looked into introducing an on premise data gateway between the service bus and our mssql database.

but not sure if we can integrate an on premise data gateway with only a azure service bus independently

Could someone Suggest the best technology to implement the same please?

How can i restrict to delete the topics from service bus explorer

$
0
0

Hi, 

    I have RootManager connection string and i connected it in service bus explorer and it's allowing me to delete the topics from service bus explorer. Once i deleted then the topics permanently deleting from service bus. 

1. How can i avoid to delete the topics from service bus explorer? can we provide any read only permission?

Kindly provide your answer that would be very helpful for me.

This is the below permission i provided for my RootManager Connection string.




Event grid subscriptions inside event grid domains created through API goes to provisioning state Creating and then disappears

$
0
0

I am using the following python packages

azure-eventgrid                       1.3.0                       
azure-mgmt-eventgrid                  2.0.0                       
azure-storage-queue                   2.0.1                       
azure-storage-common                  2.0.0                       

When I try to create an event grid subscription inside an event grid domain it temporarily goes to provisioning state Creating but then promptly disappears:

body_content = {'properties': {'destination': {'endpointType': 'StorageQueue', 'properties': {'resourceId': '/subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/Microsoft.Storage/storageAccounts/pahweilo', 'queueName': 'deeveaph'}}, 'filter': {'subjectBeginsWith': 'a/b', 'subjectEndsWith': '', 'isSubjectCaseSensitive': False}, 'labels': [], 'retryPolicy': {'maxDeliveryAttempts': 30, 'eventTimeToLiveInMinutes': 1440}}}

...

2019-07-05T07:49:23 2745 140320454567744 010:DEBUG    urllib3.connectionpool connectionpool:393:_make_request https://management.azure.com:443 "PUT /subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/Microsoft.EventGrid/domains/pahweilo/topics/allmsg/providers/Microsoft.EventGrid/eventSubscriptions/deeveaph?api-version=2019-01-01 HTTP/1.1" 201 854

...

2019-07-05T07:49:23 2745 140320454567744 010:DEBUG    urllib3.connectionpool connectionpool:393:_make_request https://management.azure.com:443 "GET /subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/Microsoft.EventGrid/domains/pahweilo/topics/allmsg/providers/Microsoft.EventGrid/eventSubscriptions/deeveaph?api-version=2019-01-01 HTTP/1.1" 200 None
2019-07-05T07:49:23 2745 140320454567744 020:INFO     root         cli:335:do_grid_recv new_subscription = {'additional_properties': {}, 'id': '/subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/Microsoft.EventGrid/domains/pahweilo/topics/allmsg/providers/Microsoft.EventGrid/eventSubscriptions/deeveaph', 'name': 'deeveaph', 'type': 'Microsoft.EventGrid/eventSubscriptions', 'topic': '/subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/microsoft.eventgrid/domains/pahweilo/topics/allmsg', 'provisioning_state': 'Creating', 'destination': <azure.mgmt.eventgrid.models.storage_queue_event_subscription_destination_py3.StorageQueueEventSubscriptionDestination object at 0x7f9ed64dc048>, 'filter': <azure.mgmt.eventgrid.models.event_subscription_filter_py3.EventSubscriptionFilter object at 0x7f9ed64dc160>, 'labels': [], 'retry_policy': <azure.mgmt.eventgrid.models.retry_policy_py3.RetryPolicy object at 0x7f9ed64dc198>, 'dead_letter_destination': None}

...

2019-07-05T07:49:24 2745 140320454567744 010:DEBUG    urllib3.connectionpool connectionpool:813:_new_conn Starting new HTTPS connection (1): management.azure.com:443
2019-07-05T07:49:25 2745 140320454567744 010:DEBUG    urllib3.connectionpool connectionpool:393:_make_request https://management.azure.com:443 "GET /subscriptions/254fa42b-cd01-4271-b0ea-5980003a7fa4/resourceGroups/rxarequinordemo/providers/Microsoft.EventGrid/domains/pahweilo/topics/allmsg/providers/Microsoft.EventGrid/eventSubscriptions/deeveaph?api-version=2019-01-01 HTTP/1.1" 404 83
2019-07-05T07:49:25 2745 140320454567744 010:DEBUG    msrest.exceptions exceptions:63:__init__ Event subscription doesn't exist.
So either I am doing it wrong or it is not working correctly. Is there some place where I can see why the subscription dissapears?

How to migrate massive amount of queues & topics under multiple service buses consolidated into 1 single service bus without recreation

$
0
0

we have lots of service buses and currently we would like to consolidate them into 1 premium tier service bus.

What is the best way to consolidate them and migrate over?

It seems currently MS doc only supports 1-1 migration with empty destination service bus. can you please advise

Thanks & Regards,

Ed

How to provide the Root Manager Connection String In Service Bus

$
0
0

Hi, 

    I have below scenario.

I created a service bus in azure portal and i have a RootManager Connection String with below access.

Now i connected the RootManager connection string in Service Bus Explorer(Version:4.1.112). i have an access to create and delete the topics.  Here i want to restricts my end user to create the topics and delete existing topics and subscriptions. That mean i want to provide only readonly access like a sql server. 

1. Is any possibility there to provide the readonly access to the RootManager Connection string. If yes please share the details.

2. If we set the readonly access then can we restrict to delete the existing topics and subscriptions.

Kindly provide your answer to mitigate the issue.

New-AzServiceBusTopic errors with 'Forbidden' error

$
0
0

I am using a Service principle to create a Service Bus topic using Azure powershell New-AzServiceBusTopiccommand. The Service principle has a custom role assigned to it which has the Action/permission "Microsoft.ServiceBus/*" assigned to it. I am guessing this action means the principle has right to perform any operation on the Service bus including creating a topic.

However calling New-AzServiceBusTopic returns error "Operation returned an invalid status code 'Forbidden'". I can however call Remove-AzServiceBusTopic and remove any existing topic in the namespace.

What permission/action do I need to assign to the custom role to be able to create the topic?

I am looking at the set available permissions at https://docs.microsoft.com/en-us/azure/role-based-access-control/resource-provider-operations#microsoftservicebus




EventGrid vs EventHub

$
0
0

I am working on a service fabric application and want to publish few events from this application and subscribe or process those publish events in another application.

I have tried EventGrid concept and observed that there is a delay while publishing and processing the events. So, now I am looking for other alternatives like EventHub or Queues, etc..

If anyone had already used EventGrid, EventHud or Queues, etc.. , Please do suggest which one will give more performance when we deal with more events.

Viewing all 1916 articles
Browse latest View live


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