Ballerina 0.8.0 ALPHA
Pre-releaseMain features of this release
Ballerina Commands Revamped
Commands used to run ballerina programs has been revamped with the newly added functionalities.
Usage:
ballerina [command] [options]
Available Commands:
run run ballerina main/service programs
build create ballerina program archives
Flags:
--help, -h for more information
Use "ballerina help [command]" for more information about a command.
e.g.
ballerina run main test.bal (run a single file test.bal which has a main method)
ballerina run service org/wso2 (start services in org.wso2 package)
ballerina build main test/foo (This is the package with main function)
ballerina build service test/foo test/bar (These are the packages with services)
Support for Ballerina package and Ballerina program with mutiple files
Ballerina functions, services and connectors can be distributed across different files and functions can be imported from same or different packages.
Worker support
Ballerina can spawn a new worker to invoke parallel tasks and let them run while main execution flow (default worker) work on it’s on tasks and get the result whenever required.
Fork-Join support
If there are more than one parallel task to be executed for the same message, ballerina can spawn multiple workers and join them in a more controlled fashion. Join condition allows users to join either all, selected or one of the selected workers within a given time period.
Data Integration
New ballerina type called ‘datatable’ is introduced to represent the database result set. A native connector called SQLConnector is introduced to interact with SQL databases. ‘select’, ‘update’, ‘call’ actions are available to perform operation against databases. Set of native functions are available in ballerina.lang.datatables package to perform operation with datatable type.
Built-in Ballerina Constructs Support
Supports for built in Functions, Connectors, Structs and TypeMappers written in ballerina. Constructs can be written with ballerina and can be packed with the ballerina runtime environment (bre) by default. All the constructs are loaded on demand.
JMS Server Connector
JMS is a well known API for sending and receiving messages between enterprise systems. This connector provides support for listening to a queue or topic in JNDI based JMS providers such as WSO2 Message broker, Apache ActiveMQ broker, etc.
JMS Client Connector
The JMS Client Connector gives the ability to send/publish JMS messages to a destination queue/topic in a JMS provider who supports JNDI such as WSO2 Message broker, Apache ActiveMQ broker, etc.
Websocket Server Connector
WebSocket is a protocol which provides full-duplex, persistent communication channels over a single TCP connection. With Ballerina WebSocket Server connector any WebSocket client can connect and send and receive WebSocket data in a asynchronous manner.
HTTP2 Server Connector
HTTP/2 Server connector provides developers to expose their HTTP apis with both HTTP/1 and HTTP/2 clients. With multiplexing support, users can send multiple requests over a single TCP Connection.
File Server Connector
File server connector provides a way to access different type of file systems in a uniform way. It supports reading files from different file systems such as local file system, FTP, SFTP, etc.
Native Utility Functions Renamed
Package names of some of the native functions have been changed as following.
- message -> messages
- array -> arrays
- json -> jsonutils
- xml -> xmlutils
- exception -> exceptions
- datatable -> datatables
- map -> maps
- typeconvertor -> typemappers
- string -> strings
- util -> utils
- system (not changed)