Using JMS 2.0 APIs to access Azure Service Bus

Using JMS 2.0 APIs to access Azure Service Bus

This article is contributed. See the original author and article here.

[Created on 12 August, 2020, and updated on 22 January, 2021]


Original post is on Medium.


https://logico-jp.medium.com/using-jms-2-0-apis-to-access-azure-service-bus-9f458ec2bf20


 


Japanese edition is here.
https://logico-jp.io/2020/08/12/using-jms-2-0-apis-to-access-azure-service-bus/


 


As you may know, support for JMS 2.0 APIs on Azure Service Bus Premium Tier is generally available. This feature allows us to interact with Azure Service Bus through JMS over AMQP 1.0.


 


Announcing general availability support for Java Message Service (JMS) 2.0 API on Azure Service Bus Premium


https://azure.microsoft.com/updates/announcing-general-availability-support-for-java-message-service-jms-20-api-on-azure-service-bus-premium/


 


As of 22 January, 2021, “preview” still exists in the document title, but it will be modified shortly.


 


Use Java Message Service 2.0 API with Azure Service Bus Premium
https://docs.microsoft.com/azure/service-bus-messaging/how-to-use-java-message-service-20




 



Note that the following document title is similar to the previous one, but this document does not cover JMS 2.0 APIs but JMS 1.1 APIs in Standard tier.





 




Use the Java Message Service (JMS) with Azure Service Bus and AMQP 1.0
https://docs.microsoft.com/azure/service-bus-messaging/service-bus-java-how-to-use-jms-api-amqp




 



In fact, we can use JMS 1.1 APIs to connect Azure Service Bus standard tier, but support for JMS 1.1 APIs is limited as you see the warning message in the document.


 



Warning
The below guide caters to limited support for Java Message Service (JMS) 1.1 API and exists for Azure Service Bus standard tier only.
Full support for the Java Message Service (JMS) 2.0 API is available only on the Azure Service Bus Premium tier in preview, which is highly recommended.



 


Which tier of Azure Service Bus supports JMS 2.0 APIs?


Premium tier only supports JMS 2.0 APIs. If using JMS 2.0 APIs to interact with Azure Service Bus Standard or Basic tier, the following exception is thrown with the message of “Full JMS 2.0 parity over AMQP is a feature supported only by a Premium Messaging namespace”.


 


image


 


Which JMS features are supported?


You can find supported features in the following URL. Note that distributed transaction is not supported.


 


What JMS features are supported?
https://docs.microsoft.com/azure/service-bus-messaging/how-to-use-java-message-service-20#what-jms-features-are-supported




 


 




Dependencies


As of 22 January, 2021, the latest version is 0.0.7. Please check the latest one in maven central repository. You can either use jar file to build your applications, or resolve dependencies through Maven or Gradle.


 


azure-servicebus-jms – ServiceBus ConnectionFactory for JMS users
https://search.maven.org/artifact/com.microsoft.azure/azure-servicebus-jms



 

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-servicebus-jms</artifactId>
  <version>0.0.7</version>
</dependency>





 





 



Give it a try!


Following the document pointed earlier, you can do it easily. Let me show you examples using JMSContext.


First of all, connection factory should be instantiated in Azure Service Bus specific manner.




import com.microsoft.azure.servicebus.jms.ServiceBusJmsConnectionFactory;
import com.microsoft.azure.servicebus.jms.ServiceBusJmsConnectionFactorySettings;

...

ServiceBusJmsConnectionFactorySettings connectionFactorySettings = new ServiceBusJmsConnectionFactorySettings();
connectionFactorySettings.setConnectionIdleTimeoutMS(20000);
ConnectionFactory factory = new ServiceBusJmsConnectionFactory("CONNECTION_STRING", connectionFactorySettings);


 



Then, application(s) can be implemented in the usual manner of JMS 2.0 APIs. The following snippet is an example to send a text message to a queue.




 

try (JMSContext jmsContext = factory.createContext() ) {
    // Create the queue and topic
    Queue queue = jmsContext.createQueue("QUEUE_NAME");
    // Create the JMS message producer
    JMSProducer producer = jmsContext.createProducer();
    // Create textmessage
    TextMessage msg = jmsContext.createTextMessage(String.format("message sent at %s", (new Date()).toString()));
    // send the message to the queue
    producer.send(queue, msg);
}
catch (JMSException e) {
    e.printStackTrace();
}


 



The next snippet is an example to receive text messages from a queue.




try (JMSContext jmsContext = factory.createContext() ) {
    // Create the queue and topic
    Queue queue = jmsContext.createQueue(”QUEUE_NAME");
    // set Message Listener
    JMSConsumer consumer = jmsContext.createConsumer(queue);
    // Listener implements MessageListener.
    consumer.setMessageListener(new Listener());
    System.out.println("Receiver is ready, waiting for messages...");
    System.out.println("press Ctrl+c to shutdown...");
    while (true) {
        Thread.sleep(1000);
    }
} catch(InterruptedException e) {
    e.printStackTrace();
}


 



Here is a code for message listener used in the sample listed above. It is pretty simple since it is used for checking messages only.




 

public class Listener implements MessageListener {
    public void onMessage(Message m) {
        try {
            TextMessage msg = (TextMessage) m;
            // Show message
            System.out.printf("[Dequeued message at %s] %sn", (new Date()).toString(), msg.getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}




 


Subscription name scheme


In case of using topic, we have generally to subscribe a topic in order to wait for messages and creating subscription in advance is required. If not created yet, a subscription is automatically created when creating a JMSConsumer object and generated subscription is deleted when closing JMSConsumer object. As of January 10, 2021, subscription name is generated with the following scheme.


 


1. JMSContext::createConsumer


In case of createConsumer method, subscription name is created as follows.


 


<GUID>$$ND

 


$ is a delimiter, and “ND” would stand for “non durable”. As createConsumer method doesn’t have any way to specify subscription name, GUID is used as an alternative subscription name. Even if setting clientID to JMSContext object, the specified clientID is not used in the subscription name.


 


image-8


2. JMSContext::createDurableConsumer


In case of createDurableConsumer method, subscription name is created as follows.


 

Spoiler (Highlight to read)

<subscriptionName>$<clientID>$D
<subscriptionName>$<clientID>$D

 


$ is a delimiter, and “D” would stand for “durable”. Both subscriptionName and clientID are mandatory and should be set to JMSContext object in the application. As you know, calling createDurableConsumer method without ClientID specified result in IllegalStateRuntimeException.


 


image-5


3. JMSContext::createSharedConsumer


In case of createSharedConsumer method, subscription name is created as follows.


 


<subscriptionName>$<clientID>$ND

 


$ is a delimiter, and “ND” would stand for “non durable”. And subscriptionName is mandatory, while clientID is optional.


 


image-6


 


So, two delimiters “$$” can be found in a subscription name when calling createSharedConsumer method without ClientID specified.


 


image-9


4. JMSContext::createSharedDurableConsumer


With clientID specified, subscription name is created as follows (subscriptionName is mandatory).


 


<subscriptionName>$<clientID>$D

 


$ is a delimiter, and “D” would stand for “durable”. This scheme is the same as the scheme of JMSContext::createDurableConsumer.


Without clientID specified, subscription name is created as follows (subscriptionName is mandatory).


 


<subscriptionName>

 


image.png


 


What benefits for you?


When migrating existing Java applications running on application servers to cloud, some customers tend to choose “lift to IaaS” strategy rather than “modernization”. Such customers tend to describe the reasons why they made such decisions.


 



“Our company has no mind to migrate their applications to PaaS since huge migration work are required.”


 


“We decided to keep our applications as it was and not to modernize them, so we chose only lift to IaaS rather than migration to PaaS in order to decrease OPEX.”


 


“We have to continue to use application servers to host our applications since the applications heavily rely on JMS and application server’s features. As of now, just simple migration to IaaS would be the best option for us.”


 


“Distribution transactions are mandatory…”



If a managed message broker is required, JMS 2.0 APIs are used in existing applications, and you have a plan to modernize your applications running on application servers, Azure Service Bus might fit you. Furthermore, if you are familiar with JMS 2.0 APIs, you don’t have to spend lots of time to learn how to develop applications with Azure Service Bus.


 


Conclusion


I confirmed Java application could interact with Azure Service Bus through JMS 2.0 APIs.


My sample codes are available on GitHub.


 


Access Azure Service Bus through JMS 2.0 APIs


https://github.com/anishi1222/Azure-Service-Bus-through-JMS-2.0-APIs

[Guest Blog] My Mixed Reality Journey: How I Became an Enterprise XR Lead

[Guest Blog] My Mixed Reality Journey: How I Became an Enterprise XR Lead

This article is contributed. See the original author and article here.

This article was written by Windows Development for Mixed Reality MVP Alexander Meijers as part of our Humans of Mixed Reality Guest Blogger Series. Alexander is also the Founder of the Mixed Reality User Group and GlobalXR.Community. He shares about his path to mixed reality, and where he sees the future of MR headed. 


 


Meet Alexander:


 


frionnet-20200630-8355.jpg


 


A not so long time ago if you had asked me what I was working as, you would be surprised. It had nothing to do with mixed reality. Back then, I had never owned a virtual reality headset or posted anything around those subjects. My professional life plainly revolved working as developer and architect for projects built on top of SharePoint and Azure. I’m not saying that I had a boring job. Far from that if you look at all the interesting projects that I had the opportunity to do. That said, it is nothing compared to all the cool things I get to do with mixed reality nowadays.


 


It all started around 6 years ago…


About 6 years ago, one of the CEOs of the company I worked for decided we needed to have a Microsoft HoloLens. The device started gathering dust on one of the shelves for a few weeks after our marketing team was done exploring it. Since I knew the person responsible for the device, I asked if it was ok if I borrowed it for the weekend.


 


“Definitely. Not a problem!”


 


That Friday evening, I came home with a Microsoft HoloLens. The first thing do when you get a HoloLens is to of course try out all the apps available in the Windows Store. While there were not many applications available at the time, some games were.


 


I found a game called Fragments. I started the game. It began with scanning and understanding the room. After that, the first holographic scene was loaded. My living room instantly transformed into a shed with water dripping through the roof. I got shivers all over my back. Never, ever had I experienced something like this. It was mind-blowing! The scene went on, and I was just in awe of the game and graphics. In the game, you were an agent who was able to see what had happened just before someone was murdered. During the game, you came together with your team – your virtual team. Depending on where they were standing, sitting down, or leaning against the table, they showed up differently in my physical space. The thing which I remembered most vividly was that one of the team members (holographically) sat down next to my girlfriend on the couch.


 


That night, I almost finished playing the entire game of Fragments in one sitting. I was captivated.


 


fragments-top.jpg


 


That was my first moment of a true immersive experience using a mixed reality device – little did I know that it would dramatically changed my life (and career path)!


 


I immediately knew that I wanted to start building mixed reality apps for Microsoft HoloLens. But how do I start? Where would I begin? What do I need? I was experienced enough with developing code. But to build something for mixed reality, you needed Unity. Unity? Never heard about it.


 


That weekend I installed tools like Unity and the mixed reality toolkit which was then called HoloToolkit. And I got to work building my first app. The app enabled me to create basic objects in the room and interact with them. It was simple but got me hooked to do even more. That Monday, I went back to the same colleague responsible for the HoloLens device and asked if it was OK for me to take the device back home every once in a while.


 


The end result? I had the device with me every day. I took the device everywhere. All of my friends, family, colleagues and even clients tried it, much to their wonder and delight.


Building something from nothing


Imagine being the only person within the company who understood the potential of this device helping our clients further. The company’s focus was mainly on SharePoint, Office 365, and Azure. As a result, I always got a lot of remarks about being in my own virtual world or jokes about me doing funny stuff with my hands, looking at virtual things which nobody else saw. But all those jokes didn’t put me off or bother me. In fact, it only encouraged me to move further with mixed reality and to show them the power of this technology and its potential very soon. It really helped that both CEOs and our marketing team understood the importance of this.


 


Within two years, we had a mixed reality department focused mainly on mixed reality implementations using Microsoft HoloLens. While we started out only doing some small Proof of Concepts, we eventually got pulled into two large projects which I’m proud of.


 


The first project was optimizing the process of deck marking. The client moved large construction structures on ships. These construction structures could not be placed directly on the deck plates and required an underlying platform comprising steel bars and/or plywood. Normally, an engineer would have to go onboard the ship and create the underlying construction based on drawings of the deck. This process could in some cases take up days or even weeks to complete. We built a mixed reality application which was able to project these underlying construction structures on the deck, allowing the engineer to finish his work much more quickly. The application was a hybrid mixed reality solution integrated with Office 365 for managing the drawings.


 


The second project was at a client who places scaffolding at their clients. These scaffoldings were large and can go up to heights of 100 meters. The developed mixed reality applications helped the scaffolders to place the base of the scaffolding at the right position to prevent mistakes which might occur after reaching heights of tens of meters in the air. This last project got us as organization into the HoloSuite at Microsoft: A 360-degree experience room at Microsoft Netherlands which allowed us to give inspirational sessions to clients around mixed reality, artificial intelligence, cloud, and security. Something I’m really proud of!


 


The community


During my journey around mixed reality, I noticed that there was a lack of community meetings around mixed reality in the Netherlands. Thus, the Mixed Reality User Group was born! We held bi-monthly community meetups with speakers from the community from all different countries/locations and organizations.


 


With the COVID-19 pandemic, it became somewhat more difficult to have these meetings. We then moved to online meetups. We held Global XR Talks – a monthly event with speakers sharing topics around virtual reality, augmented reality, mixed reality, and Web XR. Afterwards, we would virtually meet up in AltspaceVR. We also started with an annual event around the same subjects called the Global XR Bootcamp. That went on to become a huge success last year with over 50 sessions, workshops, and community meetups in 24 hours.


 


website_logo_solid_background.png


 


Nowadays, we are hard at work setting up our new platform called Global XR Community, an XR platform for news, articles, blogs and list of worldwide communities next to the Global XR Talks and the Global XR Conference. It has been an incredible journey moving from something we used to only do locally in the Netherlands, to something that we now get to do worldwide. The most important part is that it is all by the community, for the community which really differentiates the Global XR Community events from other large events.


 


Think further, think bigger


It quickly became clear to me that building mixed reality solutions is more than simply building an application using Unity. Building mixed reality applications is all about combining technologies and integrating it with different platforms. Using the best technologies together helps create the best and most useful applications.


 


I’ve always said that building a great mixed reality solution is only spending 40% in Unity while spending the other 60% in building services around it. Since I have a strong knowledge base and foundation around Microsoft 365 and Azure, this helped me to think outside of the box. Secondly, my focus went more and more towards extended reality which also incorporates virtual reality and other devices. Building large-scale solutions required us to work with more enterprise organizations with a larger IT infrastructure and back-end systems like Dynamics 365 or other similar products.


 


In 2020, COVID-19 dramatically impacted the lives of everyone – including me. The organization that I worked for at the time somehow decided that mixed reality was not the direction that they wanted to move into. I thought it was a huge mistake and did not agree with that approach. I had other ideas about it and wanted to keep on doing what I was doing since it was my passion. I then decided that I would look for another organization to work for – one that truly believed in the power and potential of mixed reality like I do.


 


That organization – for me at least – turned out to be Avanade. I started as a Global XR Tech Lead in the organization as part of the Digital Sales and Services Center of Excellence team. This happened about 6 months ago and completely changed my life. Suddenly, I was working full-time on extended reality projects for large global clients, implementing Microsoft first-party apps such as Remote Assist and Guides. I had the chance to work with large enterprise organizations on various levels, and it was so refreshing. I got to expand my scope and started thinking more about security, scalability, compliancy and adoption.


 


In my first few months, I also got involved in internal projects to build accelerators using technology like Microsoft Dynamics 365, Azure Digital Twins, Mixed Reality and Azure services, and more! My team is situated across the globe at locations including North America, Canada, Europe, and the United Kingdom, and while it sounds challenging, they are all like family to me. My mixed reality family :)


 


HoloLens2-1024x576-768x432.jpg


 


These last 6 months have been a rollercoaster ride, and I mean that in a good way. It has allowed me to grow even more and become more enterprise-focused.  I feel lucky to move into an enterprise role like this just at the right time. If you had asked me 5 years ago whether I would have chosen a role like this in a large enterprise, I would have probably kindly declined. It also comes with some benefits – while I already had a good contact with a lot of people at Microsoft, nowadays at Avanade I also have the opportunity to get involved in private previews of products and have informal sessions with product teams on regular basis. It also pushed me more in front of sales. While I already had some sales experience in my previous jobs, it feels somewhat different at this level. Not one day goes by that I don’t learn something new. And that is good.


 


Being in my role as it is now has changed my life. Believe me – extended reality will become commodity within the next one and half year. Not only that, it will become an integral part of everyone’s professional as personal lives. Just watch. 


 


I’m so happy to be part of the mixed reality journey, and hope you will get to experience the same!


 


#HumansofMixedReality #CareerJourneys

Keep your Federation Trust up-to-date

This article is contributed. See the original author and article here.

Microsoft periodically refreshes certificates in Office 365 as part of our effort to maintain a highly available and secure environment. From Jan 23rd, 2021, we are making a certificate change on our Microsoft Federation Gateway every six weeks that could affect some customers as detailed in this knowledge base article. The good news is you can easily avoid any disruption.


Who is affected?


This certificate change can affect any customer that is using the Microsoft Federation Gateway. If you are in a hybrid configuration or if you are sharing free/busy information between two different on-premises organizations using the Microsoft Federation Gateway as a trust broker, you need to take action.


When will the change occur?


After the change is scheduled to occur every six weeks. You must take action before then to avoid any disruption.


What type of issues will you face if no action is taken?


If you don’t take action, you won’t be able to use services that rely on the Microsoft Federation Gateway. For example:



  • A cloud user might not be able to see free/busy information for an on-premises user and vice versa.

  • MailTips might not work in a Hybrid configuration.

  • Cross-premises free/busy might stop working between organizations that have organization relationships in place.


Additionally, if you run the Test-FederationTrust cmdlet, you receive an error message that indicates that the Delegation token has validation issues. For example, you receive an error message that resembles the following:


Id : TokenValidation
Type : Error
Message : Failed to validate delegation token.


And, you might receive one of the following error messages in the Exchange Web Services (EWS) responses:


An error occurred when processing the security tokens in the message
Autodiscover failed for email address User@contoso.com with error System.Web.Services.Protocols.SoapHeaderException: An error occurred when verifying security for the message


What action should you take?


You can use the following command on your Exchange Server to create a scheduled task to run the update process daily. This is how we recommend you keep your Federation Trust constantly updated. This will prevent you from being negatively affected by future metadata changes.


Schtasks /create /sc Daily /tn FedRefresh /tr “C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -version 2.0 -command Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.E2010; $fedTrust = Get-FederationTrust;Set-FederationTrust -Identity $fedTrust.Name -RefreshMetadata;Set-FederationTrust -Identity $fedTrust.Name -RefreshMetadata” /ru System


If you prefer to not use a scheduled task, you can manually run the command at any time to refresh the metadata. If you choose a manual option, it will be cumbersome as you will have to keep track of this task every six weeks or run it daily.


Get-Federationtrust | Set-FederationTrust –RefreshMetadata


The Exchange Hybrid Team

Virtual Conference Focused on CMMC and Microsoft's US Sovereign Cloud

Virtual Conference Focused on CMMC and Microsoft's US Sovereign Cloud

This article is contributed. See the original author and article here.

CS2 Virtual Banner.png


 


Thursday, February 04, 2021, 08:30 AM  – 03:00 PM  (CST)









This third installment of the Cloud Security and Compliance Series (CS2) Virtual series is curated for DoD contractors looking to meet cybersecurity regulations, address security threats, and glean best practices for their Microsoft cloud investments. Many previous speakers include @RichardWakeman  (Microsoft), Katie Arrington (OUSD), and several CMMC AB board members. Next month CS2 will host @Rima Reyes , @Dave Jennings (TEAMS)  and @Morné Pretorius  of the Teams GCC / GCC High / DoD product group as well as @Matt Soseman , Microsoft Sr Architect speaking on Microsoft Defender and applications for CMMC. See below for the full set of speakers.


 


CS2 SpeakersCS2 Speakers


 


This conference will provide those currently deployed in Microsoft 365 US Sovereign Cloud environments and Azure Government the unique opportunity to hear from Microsoft stakeholders and regulatory experts, including many third-party assessors (C3PAO’s). 


 











Join us for this ongoing informational series to cover best practices for CMMC, DFARS 7012/7021, NIST 800-171 compliance, CUI and ITAR data management, Audit Preparations, Cloud Management and other security topics. Below is a session from the last CS2 in October with Richard Wakeman and Jeff Dalton of the CMMC AB.


 


https://www.youtube.com/watch?v=2BqDRIB9DxY


 


 




https://www.youtube-nocookie.com/embed/2BqDRIB9DxY



What to know about the second round of Economic Impact Payment (EIP) checks and cards

What to know about the second round of Economic Impact Payment (EIP) checks and cards

This article was originally posted by the FTC. See the original article here.

The US Department of the Treasury and the IRS are working hard to get a second round of Economic Impact Payments (EIP) to people. You might have already gotten your payment direct deposited into your bank account. That started on December 29th. You might have gotten a check in the mail. But, like last time, some people will get their payment in the mail on an EIP VISA debit card. Don’t be surprised if the way you get this second round of payments is different than the first time. Whichever way you get your payment, it’s all money the government wants you to have, and quickly. So: if you qualify for an Economic Impact Payment, look at your bank account for a direct deposit, keep an eye out for a check in the mail, or watch your mailbox carefully this month for an EIP Visa debit card.

With checks, you know the drill: get the check, deposit the check. Since you might not have gotten money on a VISA debit card before, here’s a bit more info. The EIP VISA debit card will come in an envelope that looks like this:

The debit cards are managed by Money Network Financial, LLC and issued by Treasury’s financial agent, MetaBank®, N.A., and will look like this:

If you got an EIP VISA debit card in the mail, here’s what to do.

  • Activate the EIP VISA debit card right away by calling 1-800-240-8100. To activate your card, you’ll have to give the last six digits your Social Security number. Once the card is activated, you can use it anywhere that accepts VISA debit cards, including online or in a store, or at an ATM to get cash. You also can transfer the money from the card to your personal bank account without fees. Keep in mind that the EIP debit cards will expire after three years. If that happens, call customer service to request the funds be sent to you as a check.
  • Got questions about the EIP card? Call the 24-hour call center at 1-800-240-8100. You can also visit EIPCard.com for information on using your EIP card, like where to log in to see your card balance, or where to find an in-network ATM to get money out of the card at no charge.
  • Got more general EIP questions? The IRS also has an FAQs page in English, or in Spanish.

And one last thing. Like last time, scammers are at work trying to get your money and/or personal information. Remember that the government will never call, text, email, or ask you to click on a link to activate your EIP card or get your money. If anyone does, it’s a scam. Don’t give anyone your personal or financial information, like your Social Security or bank account numbers. And never pay anyone to get your EIP funds. Report any scam immediately to the FTC at ReportFraud.ftc.gov.

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.