-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add samples from camel pages #24
base: main
Are you sure you want to change the base?
Conversation
string content; | ||
}; | ||
|
||
Blog[] blogs = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blog[] blogs = []; | |
isolated Blog[] blogs = []; |
|
||
configurable string slackToken = ?; | ||
|
||
type Blog record { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Blog record { | |
type Blog record & readonly { |
Blog[] blogs = []; | ||
|
||
service /blog on new http:Listener(9090) { | ||
slack:Client slackClient; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slack:Client slackClient; | |
final slack:Client slackClient; |
}; | ||
_ = check self.slackClient->postMessage(messageParams); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
@@ -0,0 +1,42 @@ | |||
import ballerina/http; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a proper license header.
|
||
listener http:Listener helloEP = new(9090); | ||
|
||
type Item record { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Item record { | |
type Item record & readonly { |
configurable string host = ?; | ||
configurable int port = ?; | ||
configurable string user = ?; | ||
configurable string password = ?; | ||
configurable string database = ?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we make a configuration record and use it ? Check the following code sample.
}); | ||
|
||
service on orderListener { | ||
private final kafka:Producer orderProducer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When declaring client inside a service, shall we follow a consistent approach ? (check for other places you have declared db-client, slack-client etc.)
topics: "payment_completed_topic" | ||
}); | ||
|
||
map<int> inventory = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map<int> inventory = { | |
isolated map<int> inventory = { |
import ballerinax/kafka; | ||
import wso2/orders.types; | ||
|
||
map<types:Order> ordersStore = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map<types:Order> ordersStore = {}; | |
isolated map<types:Order> ordersStore = {}; |
@@ -0,0 +1,36 @@ | |||
public type OrderRequest record {| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we mark the types as readonly
?
public type OrderRequest record {| | |
public type OrderRequest record & readonly {| |
org = "wso2" | ||
name = "orders.types" | ||
version = "0.1.0" | ||
repository = "local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository = "local" | |
repository = "local" | |
|
||
foreach types:Order 'order in orders { | ||
types:PaymentDetails paymentDetails = 'order.paymentDetails; | ||
if (isPaymentValid(paymentDetails)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (isPaymentValid(paymentDetails)) { | |
if isPaymentValid(paymentDetails) { |
maxTemp: day.maxtemp_c, | ||
minTemp: day.mintemp_c | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
Purpose
$Subject
Goals
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning