Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.
We’re thrilled to announce that a new IBM MQ Observer sample for IBM Cloud Code Engine is now available in a new IBM Messaging Code Engine Observer repo.
Code Engine provides a Kubernetes based serverless platform for applications, jobs, and functions, which can scale down to zero when there is no work to do. This pattern is attractive to solution designers as it can result in significant cost benefit in processing intermittent or variable workloads. For web applications it is relatively easy to instatiate and scale-up containers in response to incoming http requests. For enterprise messaging, application containers need to scale in response to messages on queues. This is where the new IBM MQ observer sample comes in, allowing applications to register their interest in IBM MQ queues and receiving ‘wake-up’ notifications when messages are available.
The IBM MQ Observer falls into line with the new IBM Code Engine strategy for notifying application containers. Why new? The old model had multi-tenancy watchers, which would grab the event, then wake up and notify your applications. Eg. Subscribing to Object Storage events. This has some drawbacks. You must hand your keys and data to the watcher, which could use sophisticated APIs with high quality of service to capture the event and data. Once captured the watcher then has the burden of responsibility to deliver the event data as a notification to your scalable application. This design could lead to an in-flight edge case where the event had been successfully captured, but is subsequently lost before it could be delivered successfully.
The new model has single-tenancy observers which you run. The observers listen for events. The observers don’t capture the event, instead they wake up applications or jobs letting them use the high quality of service APIs to process the events. If the event notification between observer and job fails, then there will be a fresh notification in the next observation cycle. Samples in the Code Engine repository can get you started.
A few years a go we created the tutorial Write and run serverless MQ applications in IBM Cloud that provided sample code that allowed you to run a single tenancy observer that captured a message ID and sent that as a notification to messaging applications. We allowed the observer to run anywhere, you have the choice as to whether it runs as a Code Engine application or elsewhere. We will be updating the tutorial to use the new IBM MQ observer sample.
The new IBM MQ observer sample provides new features and improvements over our previous observer sample design. For example:
You can find the IBM MQ Observer for Code Engine at https://github.com/ibm-messaging/mq-code-engine-observer
Copy