-
Notifications
You must be signed in to change notification settings - Fork 26
Home
This wiki contains the getting started content posted to both Bluemix and the Accelerate developer advocacy site.
Respond to messages and handle streams Create auto-scaling actions that execute logic in response to messages or streams.
A new programming model has emerged for cloud-native applications that enables developers to write code that responds to events, such as messages or new streams of data. Platforms like OpenWhisk provide the runtime environment to manage the containers to run that code, and automate the complete create, start, stop, destroy lifecycle of the compute resources needed. Because code runs only in response to events and is billed for the milliseconds used, rather than for idle resources reserved, this results in a better match between the cost of cloud resources consumed and business value earned.
This project shows the power of serverless, event-driven architectures to execute code in response to messages or to handle streams. It demonstrates two OpenWhisk actions, written in JavaScript that write and read text and image data to Cloudant, a hosted Apache CouchDB service. The use case demonstrates how actions can work with data services and execute logic in response to database changes.
One action connects to Cloudant and inserts text and binary data as an attachment. It is defined with package variables that provide it with Cloudant credentials as environment variables. It is uploaded to the OpenWhisk platform, where it can be invoked manually to test. A second action is created to respond to changes inserted into Cloudant by the first action. Instead of being manually invoked by the developer, a trigger and mapping rule are defined that bind it to the Cloudant database and listen for changes.
- The developer uploads and invokes the first action manually, this connects to Cloudant and inserts data.
- The data insert in turn fires an event called a trigger. This trigger is mapped to a second action by a rule.
- The second action executes in response to the event, inspects the data, and logs information to the console.
- OpenWhisk
- Message Hub
- OpenWhisk
- Message Hub
-
What makes serverless architectures so attractive? - Serverless architectures are one of the hottest trends in cloud computing this year, and for good reason. There are several technical capabilities and business factors coming together to make this approach very compelling from both an application development and deployment cost perspective.
-
Build a cloud native app with Apache OpenWhisk - At this live coding event, Daniel Krook provides an overview of serverless architectures, introduces the OpenWhisk programming model, and then deploys an OpenWhisk application on IBM Bluemix, while you watch, step-by-step.
Responding to Message Hub events with OpenWhisk
In many of today's cloud-native applications, data is generated at a huge volume and is used to link highly distributed services. Apache Kafka provides a system to transfer messages at scale, but the systems that receive those messages must be able to process and act on messages as well.
With an event-driven architecture built on OpenWhisk, you can write functions that respond to messages from queues and execute logic to process or send data to other systems in a distributed architecture. And you'll pay only for the resources consumed by your analytics functions for the fractions of a second that they ran. This gives you a tight match between transactions processed and cloud resources used.
This is the promise of an event-driven, serverless architecture for new cloud-native applications such as those that support high volume message processing. Check out the new OpenWhisk 101 project on responding to Message Hub events and start processing messages at scale, not worrying about whether you'll have enough servers manage the volume.