MQ

 View Only

 Streaming Keycloak events to MQ

Timothy Dilbert's profile image
Timothy Dilbert posted Fri October 31, 2025 03:39 PM

Anyone here have any experience with streaming Keycloak User and Admin events to MQ? Looking for a project that can get me up and running quickly.

James Hewitt's profile image
James Hewitt

You have a few options. You can turn of audit event logging to a file and stream that to mq, potentially using mq FTE features: https://www.ibm.com/docs/en/ibm-mq/9.2.x?topic=SSFKSJ_9.2.0/com.ibm.mq.adm.doc/file_to_message.htm

You can get keycloak to store events and see if there's a keycloak API to pull them out and stream them that way.

You could write a custom SPI for Keycloak to send events directly. There are good articles on this, for example: https://medium.com/@jawadrashid/implementing-keycloak-event-listener-spi-service-provider-interfaces-1f01ae819e8d

The keycloak doc is here: https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.0/html/server_administration_guide/configuring_auditing_to_track_events

Timothy Dilbert's profile image
Timothy Dilbert

After a bit more research we've settled using the native Keycloak/Kafka producer, then having a Sink Connector push the Kafka message into MQ. That appears to be the standard way to do this. My understanding is that IBM provides and supports an IBM MQ Sink Connector for Kafka Connect.

Kim Clark's profile image
Kim Clark

Yep @Timothy Dilbert the IBM MQ/Kafka connector is available and fully supported with the IBM MQ Advanced, Cloud Pak for Integration, or Event Automation licenses. It includes support for the underlying Kafka Connect framework.