1.2.12

Overview of jBallerina 1.2.12

The jBallerina 1.2.12 patch release improves upon the 1.2.11 release by addressing a number of issues.

You can use the update tool to update to jBallerina 1.2.12 as follows.

For existing users:

If you are already using jBallerina version 1.2.0, or above, you can directly update your distribution to jBallerina 1.2.12 by executing the following command:

ballerina dist update

However, you need to use the following commands instead of the above if you have installed:

  • jBallerina 1.2.0 but switched to a previous version: ballerina dist pull 1.2.12
  • a jBallerina version below 1.1.0: install via the installers

For new users:

If you have not installed jBallerina, then download the installers to install.

Standard library

websub module

Introduced 3 new hub configurations as extension points to which you can pass functions to be invoked for each event on the message, on successful delivery of updates to subscribers, and on delivery failure.

public function main() {
 
   websub:Hub webSubHub;
   var result = websub:startHub(new http:Listener(9191), "/websub", "/hub",
               hubConfiguration = {
                   tapOnMessage: tapOnMessageImpl,
                   tapOnDelivery: tapOnDeliveryImpl,
                   tapOnDeliveryFailure: tapOnDeliveryFailureImpl
               });
   if (result is websub:Hub) {
       webSubHub = result;
   } else if (result is websub:HubStartedUpError) {
       webSubHub = result.startedUpHub;
   } else {
       io:println("Hub start error:" + <string>result.detail()?.message);
       return;
   }
}
 
function tapOnMessageImpl (websub:WebSubContent content) {}
 
function tapOnDeliveryImpl (string callback, string topic, websub:WebSubContent content) {}
 
function tapOnDeliveryFailureImpl (string callback, string topic, websub:WebSubContent content, http:Response|error response, websub:FailureReason reason) {}