Open millems opened 7 years ago
Is this a planned feature? Would be awesome to see!
Just to let you know: This is possible over lambdas (so might not be a usable case for everyone). You can specify a lambda to be triggered whenever a message is sent to a specific queue. This was added in June 2018.
import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.SQSEvent; import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage;
public class LambdaHandler implements RequestHandler<SQSEvent, String> {
private static Logger log = LogManager.getLogger(LambdaHandler.class);
@Override public String handleRequest(SQSEvent event, Context context) {
for (SQSMessage message : event.getRecords()) {
log.debug("received the following message: {}", message.getBody());
}
return "{}";
} }
Customers are currently required to manually poll an SQS queue for data. An event-driven SQS consumer should be provided that handles this polling so that customers can just focus on processing messages.