Java Server Shuttle Usage - skpdi/sentinel-document GitHub Wiki
This is how to use the Shuttle library for Java Server created on the Sentinel Log Definitions page.
In terms of Shuttle for server, it has a dependency regarding to encryption. Please refer to how to use Shuttle for server web page. (Internal network)
Shuttle jar file can be included into class pass and used like the below
// Create Shuttle Instance
SampleSentinelShuttle shuttle = new SampleSentinelShuttle();
// You can use setter method that the name is same as the field name to record data in the header or body
// For example, use 'page_id' method to record 'page_id' value.
shuttle.page_id("/main/card/list")
.action_id("tap.my_card")
.card_num("2012-3XXX-XXXX-XXXX")
.card_company("Hana SK")
.expired_date("MM/YY");
// Or you can set Body value at once using 'setBodyOf' method.
// In this case, only *Body* is set like the method name.
// *KEY* header value in the method name will be set automatically.
// (In this example, 'page_id', 'action_id' are set to 'main_card_list', 'tap_my_card')
shuttle.setBodyOfMain_card_list__tap_my_card(
"2012-3XXX-XXXX-XXXX",
null /* if you don't want set value, please insert null */,
"MM/YY"
);
// When you record session_id header value and record other Body value using setBodyOf method.
shuttle.session_id("AF0EF")
.setBodyOfMain_card_list__tap_my_card("2012-3XXX-XXXX-XXXX", null ,"MM/YY");
To transfer the Shuttle that values are entered to Log Collection Tools for Server(RakeAPI, LogAgent, Direct Kafka) (example: RakeAPI)
// pass the return value of toString() of shuttle.
loggerAPI.log("your_service_topic", shuttle.toString());
toString
method also can be used for debugging.
logger.debug(shuttle.toString());