Logo
  • Products
    • SecOps Studio
  • Solutions
    • Pega Stack Shifter
  • Services
    • Pega Enablement
    • Pega Modernization
  • About
  • Contact
  • Blog
Code Vault

Java Messaging Service – Part 7 – Service JMS rule

December 10, 2024 Code Vault Curators

This is the final article in JMS series. It is going to be a short article on service JMS rule.

It is recommended to visit the previous article on JMS series, specially on JMS listener.

https://myknowtech.com/tag/jms

What is Service JMS rule?

– It is part of Integration services category and gets invoked from JMS listener rule.

– This rule is mainly responsible for Parsing/Mapping the incoming message, processing the message using service activity.

Business scenario: Let’s say an Banking organization XYZ uses different application to process the loans. A java application maintains the loan status. Whenever the loan status changes to Inactive, the Java application needs to send the message to all the interested parties. Pega is used as the customer servicing application and it is one of the interested parties for the loan Status. The Pega application needs to refresh the loan status in its data table.

Message format is fixed- <10 digit loan number><one space character><3 char status code>

Sample message – 7637473637 INA

The architecture team decided to use Java Messaging Service as the preferred solution for the business scenario. So the source application creates a single message and sends to a JMS Topic that can be consumed by one or more subscribers.

In the previous article, we created a JMS listener.

Here we will create a service JMS rule.

How to set up Service JMS?

Step 1: Create three  Integration class layers

OW3HD2-Int-ProcessLoanStatusChange

OW3HD2-Int-ProcessLoanStatusChange_Request

OW3HD2-Int-ProcessLoanStatusChange_Response

Step 2: Create the Integration properties.

6 new properties –

– 2 Page level properties Request, response that points to request, response class

– 2 single value properties for InputMessage and Output Message under request and response context respectively.

– 2 more single value property to hold the parsed request values – LoanNumber, LoanStatusCode in the request class.

Step 3: Create the parsing rule

Since the message format is always fixed, I am going to use the Map structured rule.

Visit the article to know more about Map structured rule.

Integration Mapping – Map structured rule in Pega
Step 4: Create the service activity to call the parsing and do the processing.

Step 4.1: Create a new activity in the Integration main class

Step 4.2: Add a new method Map-Structured and refer the newly created map structured rule.

For this tutorial, I am not going to do the real processing of updating loan status change.

Step 4.3: Set the response message into .Response.pyLabel

Final step.

Step 5: Create a new Service JMS rule.

Records -> Integration services -> Service JMS -> Create new

Specify the right service package name and customer class

What are the configuration points in a service-JMS rule?

There are three main tabs.

  1. Service
  2. Request
  3. Response
a. Service tab

I am not going to talk much about the service tab. It is the same reusable form in all the service types (REST, SOAP, FILE etc). Please visit my previous posts for more information! Specify the right class name and the service activity.

b. Request tab –

This is exactly the replica of connect-JMS rule. So please check the configuration explanation from the link

In short, we have three blocks of configurations.

Message headers – To map the predefined JMS headers.

Message properties – To provide additional information. Properties can be used to identify if the message is rightly intended to the recipient.

Message data –

Here from hawtio, we are going to send one block of body as message data. So I am not using the Message Key. In real time scenarios, you should always use the message Key when there are multiple message data attributes.

Also to use Message Key, you need to use Map message in Request type.

I am mapping the request data into .Request.InputMessage.

Note: Service activity is parsing the message data inside the activity. You can also use the parsing directly here in the Map to field.

c. Response tab –

Again this is standard for most for the service rules. As I promised, I want to keep the error handling for services in a separate post (a reusable post so that I can link in other service posts ;))

For now, please check the help for more details on each error condition. In the current scenario, I am going to use the default condition, so the response is always sent.

Message type as text and map the value from .Response.pyLabel, which we set from activity.

Save the Service-JMS rule.

Time to test ☺️

Step 1: Open the tracer on Service-JMS rule

Step 2: Open Hawtio and check the message count.

Step 3: Send a message to request topic.

9999999999 INA

Step 4: verify tracer and messages in topic.

You see we have enqueued a message to the response queue.

Done with JMS!!

As a summary,

– We created service Integration class layers and properties

– We created service activity rule

– We created Service JMS rule and configured the request and response tab.

JMS series is one of the tough topics for me to explain effectively. Hope you understood well.

 

  • pega-integration
Code Vault Curators

A technical team dedicated to empowering the Pega ecosystem with in-depth knowledge, guided by Premkumar Ganesan's vision.

Post navigation

Previous
Next

Pega Courses

Pega courses can be accessed at https://myknowacademy.com

Search through the blog

Tags

activity authentication background-processing case-management data-model declarative-processing email-processing file-processing pega-core-concepts pega-integration process reporting security system-administration user-interface validation

Categories

  • Code Vault

Recent posts

  • Service REST – Usage and Configurations in Pega
  • Queue processor – Usage and Configurations
  • Data Pages Usage & Configurations in Pega
  • Requestor types in Pega
  • Case Locking Mechanism in Pega

Related Articles

Code Vault

Service REST – Usage and Configurations in Pega

December 18, 2024 Code Vault Curators

First of all, don’t think INTEGRATION is a difficult topic in PEGA. I would say Integration is much easier than creating an activity rule. Pega makes it simple for developers. All you need to do is configure the Integration rules. Pega takes care of the rest. Pega provides useful wizards and guides the developers in […]

Code Vault

Service SOAP – Usage and Configurations in Pega

December 10, 2024 Code Vault Curators

In this blog article, we will see how a Pega application can host a SOAP web service. I request you to go through another blog article on Service-REST where I already talked about services in general – Update: The Concept of SOAP services remains the same across different Pega versions. The screenshots in this blog […]

Code Vault

Connect SOAP – Usage and Configurations in Pega

December 10, 2024 Code Vault Curators

In this blog article, we will try to understand about Connect-SOAP in Pega. Update: The concept of SOAP Connector remains the same across different Pega versions. Most of the screenshots in this blog article were reused from Pega 7 version and few were updated. Use this blog article to learn the concepts and you can […]

Code Vault

Connect REST – Usage and Configurations in Pega

December 10, 2024 Code Vault Curators

In this blog article, we will try to understand about Connect-REST in Pega. Connect-REST is One of the most commonly used Connectors in Pega to integrate with external systems. Update: The concept of REST Connector remains the same across different Pega versions. Most of the screenshots in this blog article were reused from Pega 7 […]

About

MyKnowTech was born with a mission to bridge the gap between technical expertise and business needs. We are a boutique firm specializing in Pega solutions, delivering them with a personal touch. At the heart of our philosophy is a commitment to putting clients first.

Company
  • About
  • Leadership
  • Career
  • Contact
Resources
  • Blog
  • Services
  • Solutions
  • Insights

©  MyKnowTech B.V. All Rights Reserved.

  • Sitemap
  • Terms & Conditions
  • Privacy Policy