[AppleScript] 纯文本查看 复制代码
//向MQ发送视频处理消息
public ResponseResult sendProcessVideoMsg(String mediaId){
Optional<MediaFile> optional = mediaFileRepository.findById(fileMd5);
if(!optional.isPresent()){
return new ResponseResult(CommonCode.FAIL);
}
MediaFile mediaFile = optional.get();
//发送视频处理消息
Map<String,String> msgMap = new HashMap<>();
msgMap.put("mediaId",mediaId);
//发送的消息
String msg = JSON.toJSONString(msgMap);
try {
this.rabbitTemplate.convertAndSend(RabbitMQConfig.EX_MEDIA_PROCESSTASK,routingkey_media_video, msg); LOGGER.info("send media process task msg:{}",msg);
}catch (Exception e){
e.printStackTrace();
LOGGER.info("send media process task error,msg is:{},error:{}",msg,e.getMessage());
return new ResponseResult(CommonCode.FAIL);
}
return new ResponseResult(CommonCode.SUCCESS);
}
[AppleScript] 纯文本查看 复制代码
//消费者并发数量 public static final int DEFAULT_CONCURRENT = 10;
@Bean("customContainerFactory") public SimpleRabbitListenerContainerFactory
containerFactory(SimpleRabbitListenerContainerFactoryConfigurer configurer, ConnectionFactory
connectionFactory) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setConcurrentConsumers(DEFAULT_CONCURRENT);
factory.setMaxConcurrentConsumers(DEFAULT_CONCURRENT);
configurer.configure(factory, connectionFactory);
return factory; }