|
@@ -19,8 +19,6 @@ import java.util.concurrent.TimeUnit;
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class RabbitConsumer implements PojoRequestHandler<Map<String, Object>, Void> {
|
|
public class RabbitConsumer implements PojoRequestHandler<Map<String, Object>, Void> {
|
|
|
|
|
|
|
|
- private static final String QUEUE_NAME = "yyc_algorithm.task_img_dup.submit.queue";
|
|
|
|
|
-
|
|
|
|
|
private static final String PIPELINE_API = "http://1861991840278303.eventbridge.cn-beijing.aliyuncs.com/webhook/putEvents?token=62ed79329bb74d0d8ede5cc5d0487a45897a6ff99f5d4d61946daf9f6e9c7fbc766b9d55ef2241edb2c2cb3aee651ac101409d2783f341aa8e8d27fdb9869d86";
|
|
private static final String PIPELINE_API = "http://1861991840278303.eventbridge.cn-beijing.aliyuncs.com/webhook/putEvents?token=62ed79329bb74d0d8ede5cc5d0487a45897a6ff99f5d4d61946daf9f6e9c7fbc766b9d55ef2241edb2c2cb3aee651ac101409d2783f341aa8e8d27fdb9869d86";
|
|
|
|
|
|
|
|
private static final OkHttpClient httpClient = new OkHttpClient.Builder()
|
|
private static final OkHttpClient httpClient = new OkHttpClient.Builder()
|
|
@@ -33,9 +31,9 @@ public class RabbitConsumer implements PojoRequestHandler<Map<String, Object>, V
|
|
|
@Override
|
|
@Override
|
|
|
public Void handleRequest(Map<String, Object> input, Context context) {
|
|
public Void handleRequest(Map<String, Object> input, Context context) {
|
|
|
log.info("函数计算启动, Request ID: {}, data:{}", context.getRequestId(), JacksonUtils.toJson(input));
|
|
log.info("函数计算启动, Request ID: {}, data:{}", context.getRequestId(), JacksonUtils.toJson(input));
|
|
|
-
|
|
|
|
|
|
|
+ String queueName = input.get("queueName").toString();
|
|
|
try (Connection connection = RabbitMQHelper.createConnection();
|
|
try (Connection connection = RabbitMQHelper.createConnection();
|
|
|
- Channel channel = RabbitMQHelper.createChannel(connection, QUEUE_NAME)) {
|
|
|
|
|
|
|
+ Channel channel = RabbitMQHelper.createChannel(connection, queueName)) {
|
|
|
|
|
|
|
|
startConsumer(channel);
|
|
startConsumer(channel);
|
|
|
log.info("RabbitMQ 消费者启动成功");
|
|
log.info("RabbitMQ 消费者启动成功");
|