This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function main() { | |
string[] arr = []; | |
while true { | |
arr.push("value"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.UnsatisfiedLinkError: failed to load the required native library | |
at io.netty.handler.ssl.OpenSsl.ensureAvailability(OpenSsl.java:601) | |
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:831) | |
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:615) | |
at io.ballerina.stdlib.http.transport.contractimpl.common.ssl.SSLHandlerFactory.createHttp2TLSContextForClient(SSLHandlerFactory.java:360) | |
at io.ballerina.stdlib.http.transport.contractimpl.sender.HttpClientChannelInitializer.configureSslForHttp2(HttpClientChannelInitializer.java:207) | |
at io.ballerina.stdlib.http.transport.contractimpl.sender.HttpClientChannelInitializer.initChannel(HttpClientChannelInitializer.java:139) | |
at io.ballerina.stdlib.http.transport.contractimpl.sender.HttpClientChannelInitializer.initChannel(HttpClientChannelInitializer.java:75) | |
at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129) | |
at io.nett |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Represents a conference | |
# | |
# + id - The id of the conference | |
# + name - The name of the conference | |
public type Conference record {| | |
readonly int id; | |
string name; | |
|}; | |
# Represents a conference request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerinax/java.jdbc; | |
import ballerina/sql; | |
import ballerina/http; | |
import ballerinax/h2.driver as _; | |
# Represents the configuration of the h2 database | |
# | |
# + user - The user of the database | |
# + password - The password of the database | |
# + dbName - The file path of the database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
# Represents a Error Detail | |
# | |
# + message - The message of the error | |
# + cause - The cause of the error | |
public type ErrorDetail record {| | |
string message; | |
string cause; | |
|}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
import ballerina/mime; | |
configurable string countryServiceUrl = ?; | |
configurable H2dbConfigs dbConfigs = ?; | |
service class ConferenceService { | |
*http:Service; | |
final ConferenceDBClient conferenceDBClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/log; | |
import ballerina/http; | |
import ballerina/lang.runtime; | |
configurable int conferenceServicePort = ?; | |
public function main() returns error? { | |
http:Listener conferenceListener = check new (conferenceServicePort); | |
log:printInfo("Starting the listener..."); | |
// Attach the service to the listener. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conferenceServicePort = 8102 | |
countryServiceUrl = "http://localhost:9000" | |
# The database related configs | |
[dbConfigs] | |
dbName = "conferencedb" | |
user = "admin" | |
password = "admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Add a new conference | |
POST http://localhost:8102/conferences | |
Content-Type: application/json | |
{ | |
"name": "WSO2Con" | |
} | |
### Retrive all conferences | |
GET http://localhost:8102/conferences |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "time = $(date +"%Y-%m-%dT%H:%M:%S.%3N%:z") level = INFO module = tharmigan/conference_service message = Executing the Ballerina application" | |
if [ "$1" = "graalvm" ]; | |
then | |
./target/bin/conference_service_ballerina | |
else | |
java -jar ./target/bin/conference_service_ballerina.jar | |
fi |
OlderNewer