Publish Usage Events to Kafka

 

A Transaction Log Broker module publishes transaction log events to a topic on the Cluster Manager's message broker. Limit it to the Patient Access API endpoint's FHIR requests, so that the topic only carries Patient Access API usage.

Create the Module

Transaction Log Broker modules are configured in Properties mode. Add the following to your properties file:

module.tx_broker_patient_access.type=TRANSACTION_LOG_BROKER
module.tx_broker_patient_access.config.broker.channel_name=channel_patient_access_txlog
module.tx_broker_patient_access.config.event_whitelist=http_patient_access.FHIR_REQUEST|*
module.tx_broker_patient_access.config.persist_bodies_in_clustermgr_db=false
  • broker.channel_name – The Kafka topic. The channel naming prefix is not applied to this name, so include any required prefix here.
  • event_whitelist – http_patient_access.FHIR_REQUEST|* selects all FHIR request events from the Patient Access API endpoint. Replace http_patient_access with your endpoint's module ID.
  • persist_bodies_in_clustermgr_db – Set to false to omit request and response bodies from the published events. Usage reporting does not need the bodies, and omitting them keeps the member's FHIR resources out of the topic. This setting does not affect additionalJson.

Restart Smile CDR to start the module.

Consume the Topic

Each message is a transaction log event in the format described in Usage Event Format. When Kafka is used, the event's transactionGuid is the partitioning key. The payer's reporting consumer reads the topic and aggregates the events, as described in Usage Reporting.