sqs源上的Siddhi轮询间隔不起作用

时间:2019-08-09 10:58:27

标签: amazon-sqs siddhi

嗨,我是Siddhi的新手,并且已经设置了具有SQS源的应用程序,我尝试将轮询间隔设置为10秒,将最大邮件数设置为1。

但是,我只是得到了恒定的消息流,好像它只是在忽略值一样。

这是我的代码,其中删除了敏感信息


@App:name('SQS TEST')
@App:description('Description of the plan')

@source(type = 'sqs', 
    queue = '',
    access.key = '',
    secret.key = '',
    region = '',
    polling.interval = '10000',
    wait.time = '20',
    max.number.of.messages = '1',
    delete.messages='false', 
    number.of.parallel.consumers = '1',
    @map(type = 'json', fail.on.missing.attribute='false', enclosing.element='$.entries',
        @attributes(val1 = 'val1', val2='val2')))

define stream inStream (val1 string, val2 string);

@sink(type = 'log', prefix = 'Cafe Feed:')
define stream log_received (val1 string, val2 string);

from inStream
select val1,val2
insert into log_received;

任何帮助将不胜感激,谢谢。

1 个答案:

答案 0 :(得分:0)

SQS源的默认行为是从sqs队列中提取消息,直到队列中没有消息为止,亚马逊API允许开发人员定义以上const LOG_LEVELS = ['error', 'warn', 'info', 'debug']; class Logger { public [key in LOG_LEVELS]: (message: string) => void; public log (level: string, message: string): void { // some code for logging } } for (const LEVEL of LOG_LEVELS) { Logger.prototype[LEVEL] = function (message: string): void { this.log(LEVEL, message); }; } 公开的每个请求检索的消息数该财产。

要解决此问题,您可以将队列的可见性超时固定为更大的值,以阻止返回消息或从队列中读取消息后删除消息。

相关问题