이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 10. Replicating audit data in a JMS message broker


You can replicate KIE Server audit data to a Java Message Service (JMS) message broker, for example ActiveMQ or Artemis, and then dump the data in an external database schema so that you can improve the performance of your Spring Boot application by deleting the audit data from your application schema.

If you configure your application to replicate data in a message broker, when an event occurs in KIE Server the record of that event is stored in the KIE Server database schema and it is sent to the message broker. You can then configure an external service to consume the message broker data into an exact replica of the application’s database schema. The data is appended in the message broker and the external database every time an event is produce by KIE Server.

Note

Only audit data is stored in the message broker. No other data is replicated.

Prerequisites

  • You have an existing Red Hat Decision Manager Spring Boot project.

Procedure

  1. Open the Spring Boot application’s pom.xml file in a text editor.
  2. Add the KIE Server Spring Boot audit dependency to the pom.xml file:

    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-server-spring-boot-autoconfiguration-audit-replication</artifactId>
      <version>${version.org.kie}</version>
    </dependency>
    Copy to Clipboard
  3. Add the dependency for your JMS client. The following example adds the Advanced Message Queuing Protocol (AMQP) dependency:

    <dependency>
      <groupId>org.amqphub.spring</groupId>
      <artifactId>amqp-10-jms-spring-boot-starter</artifactId>
      <version>2.2.6</version>
    </dependency>
    Copy to Clipboard
  4. Add the JMS pool dependency:

    <dependency>
      <groupId>org.messaginghub</groupId>
      <artifactId>pooled-jms</artifactId>
    </dependency>
    Copy to Clipboard
  5. To configure KIE Server audit replication to use queues, complete the following tasks:

    1. Add the following lines to your Spring Boot application’s application.properties file:

      kieserver.audit-replication.producer=true
      kieserver.audit-replication.queue=audit-queue
      Copy to Clipboard
    2. Add the properties required for your message broker client. The following example shows how to configure KIE Server for AMPQ, where <JMS_HOST_PORT> is the port that the broker listens on and <USERNAME> and <PASSWORD are the login credentials for the broker:

      amqphub.amqp10jms.remote-url=amqp://<JMS_HOST_PORT>
      amqphub.amqp10jms.username=<USERNAME>
      amqphub.amqp10jms.password=<PASSWORD>
      amqphub.amqp10jms.pool.enabled=true
      Copy to Clipboard
    3. Add the following lines to the application.properties file of the service that will consume the message broker data:

      kieserver.audit-replication.consumer=true
      kieserver.audit-replication.queue=audit-queue
      Copy to Clipboard
    4. Add the properties required for your message broker client to the application.properties file of the service that will consume the message broker data. The following example shows how to configure KIE Server for AMPQ, where <JMS_HOST_PORT> is the port that your message broker listens on and <USERNAME> and <PASSWORD> are the login credentials for the message broker:

      amqphub.amqp10jms.remote-url=amqp://<JMS_HOST_PORT>
      amqphub.amqp10jms.username=<USERNAME>
      amqphub.amqp10jms.password=<PASSWORD>
      amqphub.amqp10jms.pool.enabled=true
      Copy to Clipboard
  6. To configure KIE Server audit replication to use topics, complete the following tasks:

    1. Add the following lines to your Spring Boot application’s application.properties file:

      kieserver.audit-replication.producer=true
      kieserver.audit-replication.topic=audit-topic
      Copy to Clipboard
    2. Add the properties required for your message broker client to the application.properties file of the service that will consume the message broker data. The following example shows how to configure KIE Server for AMPQ, where <JMS_HOST_PORT> is the port that your message broker listens on and <USERNAME> and <PASSWORD are the login credentials for the message broker:

      spring.jms.pub-sub-domain=true
      amqphub.amqp10jms.remote-url=amqp://<JMS_HOST_PORT>
      amqphub.amqp10jms.username=<USERNAME>
      amqphub.amqp10jms.password=<PASSWORD>
      amqphub.amqp10jms.pool.enabled=true
      Copy to Clipboard
    3. Add the following lines to the application.properties file of the service that will consume the message broker data:

      kieserver.audit-replication.consumer=true
      kieserver.audit-replication.topic=audit-topic::jbpm
      kieserver.audit-replication.topic.subscriber=jbpm
      spring.jms.pub-sub-domain=true
      Copy to Clipboard
    4. Add the properties required for your message broker client to the application.properties file of the service that will consume the message broker data. The following example shows how to configure KIE Server for AMPQ, where <JMS_HOST_PORT> is the port that your message broker listens on and <USERNAME> and <PASSWORD> are the login credentials for the message broker:

      amqphub.amqp10jms.remote-url=amqp://<JMS_HOST_PORT>
      amqphub.amqp10jms.username=<USERNAME>
      amqphub.amqp10jms.password=<PASSWORD>
      amqphub.amqp10jms.pool.enabled=true
      amqphub.amqp10jms.clientId=jbpm
      Copy to Clipboard
  7. Optional: To configure the KIE Server that contains the replicated data to be read only, set the org.kie.server.rest.mode.readonly property in the application.properties file to true:

    org.kie.server.rest.mode.readonly=true
    Copy to Clipboard

10.1. Spring Boot JMS audit replication parameters

The following table describes the parameters used to configure JMS audit replication for Red Hat Decision Manager applications on Spring Boot.

Table 10.1. Spring Boot JMS audit replication parameters
ParameterValuesDescription

kieserver.audit-replication.producer

true, false

Specifies whether the business application will act as a producer to replicate and send the JMS messages to either a queue or a topic.

kieserver.audit-replication.consumer

true, false

Specifies whether the business application will act as a consumer to receive the JMS messages from either a queue or a topic.

kieserver.audit-replication.queue

string

The name of the JMS queue to either send or consume messages.

kieserver.audit-replication.topic

string

The name of the JMS topic to either send or consume messages.

kieserver.audit-replication.topic.subscriber

string

The name of the topic subscriber.

org.kie.server.rest.mode.readonly

true, false

Specifies read only mode for the business application.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat