简体   繁体   English

如何在单独的spring集成应用程序中实现JMS入站和出站配置?

[英]How to implement the JMS Inbound & Outbound configuration in separate spring integration application?

My use case is notification service implementation in our project. 我的用例是项目中的通知服务实现。

We have used spring with jms and its working fine with rest services. 我们已经将spring与jms结合使用,并且将其与rest服务一起使用可以正常工作。 Able to send message to queue from one application and receive a message from queue in another application using JMSTemplate's convertAndSend(), convertAndReceive() functions. 能够使用JMSTemplate的convertAndSend()和convertAndReceive()函数从一个应用程序发送消息到队列,并从另一个应用程序的队列接收消息。

Now I want to do this using spring integration's java dsl approach. 现在,我想使用Spring Integration的java dsl方法做到这一点。 We did a sample by using Jms's inboundGateway() and outboundGateway() in single application with ActiveMQ. 我们通过在具有ActiveMQ的单个应用程序中使用Jms的inboundGateway()和outboundGateway()进行了示例。

How to use spring integration's java dsl in different application for only sending/receiving messages? 如何在不同的应用程序中使用Spring Integration的java dsl仅用于发送/接收消息?

Here is my code, 这是我的代码,

@Bean
public IntegrationFlow jmsInboundFlow() {
    return IntegrationFlows
            .from(Jms.inboundGateway(this.connectionFactory)
                    .destination("pan.outbound"))
            .transform((String s) -> s.toUpperCase())
            .channel("in-bound-request-channel")
            .get();
}

@Bean
public IntegrationFlow jmsOutboundGatewayFlow() {
    return IntegrationFlows.from("out-bound-request-channel")
            .handle(Jms.outboundGateway(this.connectionFactory)
                        .requestDestination("pan.outbound"))
            .log()
            .bridge()
            .get();
}

@MessagingGateway
interface EchoGateway {

    @Gateway(requestChannel = "out-bound-request-channel")
    String send(String message);

}

You have only to split configuration - JMS inbound adapter in one application and JMS outbound in second. 您只需要拆分配置-一个应用程序中的JMS入站适配器,第二个应用程序中的JMS出站。 The way is exactly the same as in one application ? 方式与一个应用程序完全相同吗? (Maybe I missed some information?) (也许我错过了一些信息?)

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

相关问题 Spring集成JMS在入站和出站都发布订阅 - Spring-integration JMS publish subscribe in both inbound and outbound Spring集成 - 入站和出站通道适配器 - Spring Integration - Inbound vs Outbound Channel Adapters Spring 出站/入站集成代码共享 - Spring Integration code sharing between outbound/inbound Spring Integration,JMS入站通道适配器和事务 - Spring Integration, JMS Inbound channel adaptor and transactions Spring 与 JMS 出站适配器的集成文件 - Spring integration file with JMS outbound adapter int-jms 的 Java 配置:来自 Spring 集成的出站通道适配器 - Java configuration for int-jms:outbound-channel-adapter from spring integration Spring集成TCP入站/出站适配器与非Spring客户端 - Spring Integration TCP inbound/outbound adapter with non-Spring client Spring Integration xml to java dsl - 如何定义入站/出站通道适配器,轮询器等 - Spring Integration xml to java dsl - how to define inbound/outbound channel adaptors, pollers, etc Spring Integration:将一个入站邮件复制到多个出站邮件 - Spring Integration: copy one inbound message to multiple outbound 具有JBoss createConnection()的Spring Integration入站JMS:IllegalArgumentException:ClassCastException - Spring Integration inbound JMS with JBoss createConnection(): IllegalArgumentException: ClassCastException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM