Skip to content

Instantly share code, notes, and snippets.

// Specify the Siddhi application name.
var siddhiApplication = 'LoginRiskCalculator';
// Specify the Siddhi input stream name.
var siddhiInputStream = 'InputStream';
function onLoginRequest(context) {
executeStep(1, {
onSuccess: function (context) {
getRiskOfLoginAttempt(context);
}
@Source(type = 'http-request', source.id='testsource', receiver.url="https://localhost:8280/Analytics/InputStream",
@map(type='json',
@attributes(messageId='trp:messageId',
username='$.event.username',
loginTime='$.event.loginTime',
loginIp = '$.event.loginIp')))
define stream InputStream (messageId string, username string, loginIp string, loginTime long);
BasicAWSCredentials credentials = new BasicAWSCredentials("accessKey", "secretKey");
sqs = AmazonSQSClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.withRegion(configs.getRegion())
.build();