We have an on premises web app that uses NServicebus and we want to move the queues to azure (as part of a larger migration path to entirely cloud based). I am trying to work up a POC but can’t seem to get it working.
I have the following configuration:
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
<section name="AzureQueueConfig" type="NServiceBus.Config.AzureQueueConfig, NServiceBus.Azure"/>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core"/>
</configSections>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<AzureQueueConfig QueueName="timeoutmanager"
ConnectionString="DefaultEndpointsProtocol=https;AccountName=<My storage account>;AccountKey=<My primary access key>"/>
<UnicastBusConfig TimeoutManagerAddress="timeoutmanager">
<MessageEndpointMappings>
<add Messages="TechFu.Services.Bus.Messages.Publishing.CMS.SitePagePublishMessage, TechFu.Services.Bus.Messages" Endpoint="sitepagepublish" />
</MessageEndpointMappings>
In my application I have the bus configures as:
Configure.WithWeb()
.StructureMapBuilder()
.InMemorySubscriptionStorage()
.AzureMessageQueue()
.JsonSerializer()
.UnicastBus()
.LoadMessageHandlers()
.IsTransactional(true)
.CreateBus()
.Start();
When I try posting to the queue, I get the following message:
The destination queue 'sitepagepublish# DefaultEndpointsProtocol=https;AccountName=<My storage account>;AccountKey=<My primary access key>’ could not be found. You may have misconfigured the destination for this kind of message (TechFu.Services.Bus.Messages.Publishing.CMS.SitePagePublishMessage) in the MessageEndpointMappings of the UnicastBusConfig section in your configuration file. It may also be the case that the given queue just hasn't been created yet, or has been deleted.
I’m at a bit of a loss, I’ve tried several different samples I’ve found on the web, but I feel like my lack of azure knowledge is getting in the way. I pulled the majority of the configuration from this question: nservicebus on-premise host using azure Queue Is there some magic that I’m missing?
Does the destination queue exist? NServiceBus only creates source queues by default so if the destination does not exist it won't create it for you.
I don't think this will work because the subscription messages can't be exchanged between both of the hosts.
Better use Gateway concept of NServiceBus which will distribute messages across different sites.
Could you try removing any reference to MsmqTransportConfig from your configuration file? (when using Azure queues you are actually replacing the MSMQ transport)
I am not familiar with NServicebus. But Windows Azure has a built-in Service Bus, and it can integrate with queue naturally. You can refer to http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_ServiceBusMessaging for a tutorial.
Best Regards,
Ming Xu.
Related
I try to publish an App on windows 10 store, but I can not pass test from Windows App Certification Kit:
Restricted Namespace Error encountered: The restricted namespace test
Detected the following errors: Restricted Namespace found:
Impact if not corrected: The Windows Store does not allow an
Application manifest to refer to restricted namespaces. How to fix it:
Removes restricted namespaces from the application manifest.
But I use a restricted namespace for use SMS functions:
Xmlns: r = "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
r: Capability Name = "cellularMessaging" />
How can made this changes to publish ?
You must also add the rescap namespace IgnorableNamespaces in the Package.appxmanifest file as shown below.
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="cellularMessaging" />
</Capabilities>
</Package>
When adding capabilities, keep them in the following order: 'Capability', 'rescap:Capability', then 'DeviceCapability', as there seems to be a problem when mixing them. (source)
Note that the app certification test will probably continue to fail. You need to request permission to actually use these capabilities.
Special and restricted capabilities are intended for very specific
scenarios. The use of these capabilities is highly restricted and
subject to additional Store onboarding policy and review. Follow the
steps below to request access to a restricted capability before
submitting your app to the store.
Determine if you are eligible to submit your app to the store with a
specific restricted capability by looking at the table below. If you
are not eligible, any requests you make will be denied.
If you are eligible visit the Submitting an App support page.
Set the problem type to App submission and certification and the category type to Submitting an app using a restricted capability.
Include the capability you are requesting access to and include a reason for your request. If you do not provide all the information necessary, your
request will be denied. You may also be asked to provide more
information.
Source
When I try to create a MySQL database on Microsoft Azure using pure REST request (PUT) to:
https://management.azure.com/subscriptions/<subscriptionid>/resourceGroups
/resource-<id>/providers/successbricks.cleardb/databases/<my-database>?
api-version=2014-04-01
I am getting this error:
HTTP STATUS CODE 400 Bad Request
Error message: 'Legal terms have not been accepted for this item on
this subscription. To accept legal terms, please go to the Azure
portal (http://go.microsoft.com/fwlink/?LinkId=534873) and configure
programmatic deployment for the Marketplace item or create it there
for the first time'
So I went to Microsoft Azure Portal, and I accepted the legal terms. I tried again, same error. I searched in almost the entire Azure Portal for some configuration about this and I found nothing.
Someone have the same problem?
Thanks.
you should not only accept the terms but follow the procedure of making the programmatic access possible. It should be on the license page.
Programmatic deployment only can be found in Virtual Machines MySQL, not in Data Storage MySQL Database. Try REST request after you enabled programmatic Deployment.
In addition, I successfully created a MySQL database using REST API without reproducing your question, but note that the request body need to be sent as well when using PUT request.
OK guys, found the solution. I don't know why, but if we change the JSON attribute { "plan.name": "Pay-As-You-Go" } to { "plan.name": "Free" } the database is created successfully.
I opened a support ticket to know which are the MySQL available plans. I will update the answer as soon as possible.
now I run on new problems with scout testing.
I have Client fragment project for testing and I would like to test some templates I created.
My problem is that this templates contains some SmartFields and I would like to test them. For this I probably need ScoutServerTestRunner, so the server is up and running.
But If I try to add it I get error :
#RunWith(ScoutServerTestRunner.class)
#ServerTest()
I get error :
ServerTest cannot be resolved to a type
, all of my assert imports are deleted and I get error on my package line suggesting me Configure build path.
My guess is that this can't be done because it is client fragment and it can't connect to server.
But how then test smartFields ?
From your question I guess that there is some misunderstanding...
ScoutServerTestRunner and #ServerTest is something similar to ClientServerTestRunner and #ClientTest but for the server. You will need it for tests testing the server.
The classes are located in the org.eclipse.scout.rt.testing.server bundle.
If in a client test you need a server you have two possibilities:
A/ Start a server
You can start a server
This will probably not be the normal server (the one like in production) because you want to control the database or some external services. Authentication might also be slightly different (in order to control it and to have something compatible with your tests)
For the integration in your maven build, the maven-cargo plugin can be used to start your server before executing the client test suite.
B/ Mock the server services
Each of the services call that creates a ProxyService calling the server, can be replaced by mock (client only).
This is the preferred way for unit test, because you do not rely on a deployed server. You can also define for each test what the server answer will be.
This solutions requires probably initially more work, but in my opinion it worth it.
To register an alternative service, you can use:
TestingUtility.registerServices(
<activator instance>,
<priority>,
<service instances>
);
The service with the higher priority will win.
In each test, do not forget to un-register the alternative services you have registered.
SmartFields are using CodeTypes or LookupCalls. In case of a LookupCall, the LookupCall is probably calling the server through a LookupService. In case of a CodeType, the SmartField is internally using the CodeLookupCall class relying on a ICodeService.
In both cases, if you want to run your test without a server, you need to ensure that the client uses alternative implementations of the required services that do requires a server.
Is there a way to access the JBoss JMX data via JSON?
I am trying to pull a management console together using data from a number of different servers. I can achieve this using screen scraping, but I would prefer to use a JSON object or XML response if one exists, but I have not been able to find one.
You should have a look at Jolokia, a full featured JSON/HTTP adapter for JMX.
It supports and has been tested on JBoss as well as on many other platforms. Jolokia
is an agent, which is deployed as a normal Java EE war, so you simply drop it into your
deploy directory within you JBoss installation. Also, there a some client libraries available, e.g. jmx4perl which allows for programatic access to the agent.
There is much more to discover and it is actively developed.
If you are using Java, then you can make small program that make JMX request to JBoss server and transform the response into XML/JSON.
Following is small code snippet. This may help you.
String strInitialProp = "javax.management.builder.initial";
System.setProperty(strInitialProp, "mx4j.server.MX4JMBeanServerBuilder");
String urlForJMX = "jnp://localhost:1099";//for jboss
ObjectName objAll = ObjectName.getInstance("*:*");
JMXServiceURL jmxUrl = new JMXServiceURL(urlForJMX);
MBeanServerConnection jmxServerConnection = JMXConnectorFactory.connect(jmxUrl).getMBeanServerConnection();
System.out.println("Total MBeans :: "+jmxServerConnection.getMBeanCount());
Set mBeanSet = jmxServerConnection.queryNames(objAll,null);
There are some jmx-rest bridges available, that internally talk JMX to MBeans and expose the result over REST calls (which can deliver JSON as data format).
See e.g. polarrose or jmx-rest-access. There are a few others out there.
I am new to NServcie bus and Im was trying to implement Publication and subscription of messages .This is the error I'm getting
Exception when starting endpoint, error has been logged. Reason: The destination queue 'mygateway' could not be found. You may have misconfigured the destination for this kind of message (NServiceBus.Unicast.Transport.CompletionMessage) in the MessageEndpointMappings of the UnicastBusConfig section in your configuration file.It may also be the case that the given queue just hasn't been created yet, or has been deleted.
This is the configuration used that i used in app config
<MsmqTransportConfig
InputQueue="publisherqueue"
ErrorQueue="error"
NumberOfWorkerThreads="1"
MaxRetries="5" />
<UnicastBusConfig
DistributorControlAddress=""
DistributorDataAddress=""
ForwardReceivedMessagesTo="">
<MessageEndpointMappings>
<add Messages="Messages"
Endpoint="mygateway" />
</MessageEndpointMappings>
</UnicastBusConfig>
<MsmqSubscriptionStorageConfig
Queue="GateWaySubscriptions" />
My question is why this "mygateway " queue is not automatically created ? Am i doing anything wrong ? Please help.
Thanks
Alex.
This app you are configuring for only "owns" (use that term loosely) the queues in MsmqTransportConfig, namely, "publisherqueue" and "error". These are the only queues it will attempt to create for you.
Your MessageEndpointMappings section defines "remote" queues, i.e. your desire to either send messages from Messages to mygateway, or subscribe to Messages from mygateway. Another endpoint, with "mygateway" as its input queue, would be responsible for it up.
So what your app is telling you is "I see that you're interested in exchanging messages with mygateway, but I knocked and nobody's home."