Skip to content

majguo/jboss-eap-on-app-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run JMS sample on JBoss EAP Azure App Service

This JMS sample is based on https://github.com/jboss-developer/jboss-eap-quickstarts/tree/7.4.x/helloworld-mdb.

You can also refer to https://github.com/RedHat-Middleware-Workshops/eap7-modernization/blob/master/exercise4-messaging.adoc for more detailed description about the sample.

To better understand how message-driven bean is used for processing messages, pls refer to Receiving Messages Asynchronously Using a Message-Driven Bean.

Follow steps below to deploy and run the sample on JBoss EAP Azure App Service:

  1. Clone this repo in your local file system.

  2. Change directory to sample project cd <local-clone-of-repo>/jms-helloworld-mdb.

  3. Configure web app using Azure Web App Maven Plugin.

    mvn com.microsoft.azure:azure-webapp-maven-plugin:2.5.0:config
    

    Below is an example of the webapp properties configured:

    Subscription Id : <sub-id>
    AppName : jboss-helloworld-mdb-<random-id>
    ResourceGroup : jboss-helloworld-mdb-<random-id>-rg
    Region : centralus
    PricingTier : P1v3
    OS : Linux
    Java : Java 11
    Web server stack: Jbosseap 7
    Deploy to slot : false
    

    Log down values for ResourceGroup and AppName, you will use it later.

  4. Deploy the sample app.

    mvn package azure-webapp:deploy -DskipTests
    

    If you encounter the similar error message below, open pom.xml and change region or pricingTier accordingly.

    This region has quota of 0 PremiumV3 instances for your subscription. Try selecting different region or SKU.
    

    Re-deploy the sample app until no erros observed.

    Once the app is successfully deployed, you should see the endpoint of web app output in the command prompt.

    Successfully deployed the artifact to https://jboss-helloworld-mdb-<random-id>.azurewebsites.net
    

    Copy the endpoint URL and open it in the browser, you should see the similar UI as below:

    helloworld-mdb-ui

  5. Inspect JBoss EAP server log to see the result of messages processing.

    1. Sign in to Azure portal.
    2. Open resource group with the value of ResourceGroup you logged down before.
    3. Open the App Service with the value of AppName you logged down before.
    4. Open SSH page under Development Tools. Click Go to open a new browser tab for webssh.
      1. The path of application log file looks like LogFiles/Application/server.<random-id>.log. Replace placeholder <random-id> with the real one.
      2. Run tail -f <path-of-application-log-file> -n 100 to monitor messages processing.
      3. Switch to the UI page of sample app you opened before. Refresh the page.
      4. Swtich back to webssh page. You should see the similar messages output.
        2022-05-25 06:56:20,127 INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-5 (ActiveMQ-client-global-threads)) Received Message from queue: This is message 3
        2022-05-25 06:56:20,127 INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-4 (ActiveMQ-client-global-threads)) Received Message from queue: This is message 2
        2022-05-25 06:56:20,135 INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-3 (ActiveMQ-client-global-threads)) Received Message from queue: This is message 1
        2022-05-25 06:56:20,149 INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-6 (ActiveMQ-client-global-threads)) Received Message from queue: This is message 4
        2022-05-25 06:56:20,216 INFO  [class org.jboss.as.quickstarts.mdb.HelloWorldQueueMDB] (Thread-7 (ActiveMQ-client-global-threads)) Received Message from queue: This is message 5
        
  6. In the preceding steps, you created Azure resources in a resource group. If you don't need the resources in the future, delete the resource group from portal.

References

There is a good reference JBoss EAP on App Service demo which can help you get started with Jboss EAP on App Service.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published