繁体   English   中英

从 IBM MQ spring 引导列表器接收有效负载,然后在功能方法中将数据发送到 rabbit mq

[英]Receive Payload from IBM MQ spring boot listner then send data to rabbit mq in functional approch

//take message from ibm mq    
@JmsListener(destination = "${ibm.mq.ackqueue}", concurrency="${ibm.mq.concurrency}")
public void receive(Message message){//get playload}

@Bean
public Function<Response, EventDto> transformEvent() {
//take response from ibm mq
//then process and send eventdto to rabbit mq from spring cloud stream approach
}

这两种方法都是需要功能的方法。

由于您正在从任意资源(在本例中为 JMS)接收消息,并且您想使用 sc-stream 将此类消息发送到 RabbitMQ,因此您可以使用专门为这种情况设计的组件 - StreamBridge

只需自动装配它并在接收方法中使用它来向 Rabbit 发送消息(假设 rabbit binder 在类路径上)

你不需要

@Bean
public Function<Response, EventDto> transformEvent() {
//take response from ibm mq
//then process and send eventdto to rabbit mq from spring cloud stream approach
}

你可以在这里找到更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM