spring-integration

Spring integration - AMQP backed message channels and message conversion

↘锁芯ラ 提交于 2019-12-08 04:34:41
问题 I am trying to use AMQP-backed message channels in my Spring Integration app, but I think I am fundamentally misunderstanding something, specifically around the Message<?> interface and how instances of GenericMessage<?> are written to and read from, a RabbitMQ queue. Given I have a Spring Integration app containing the following domain model object: @Immutable class Foo { String name long quantity } and I declare an AMQP backed message channel called fooChannel as follows: @Bean public

Spring integration multiple clients connecting to server port

随声附和 提交于 2019-12-08 02:58:25
问题 From my application, I need to configure multiple client connections that needs to connect to a single server. To do this, I create a variable amount of beans with the ApplicationContext Beanfactory, based on how many clients I have configured. Here is the code for 2 clients: //setup beans; AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.scan("pkg"); ConnectionFactory factory = new ConnectionFactory(); int clients = 2; //TODO read this value from file

Spring Integration and Transaction with JMS and DB

半城伤御伤魂 提交于 2019-12-08 02:48:02
问题 I am using spring integration to send information to other systems via JMS. Currently in the system we have the following steps: update a status in the oracle database to say "Approved" send a JMS message off to external system. commit a. So what if sending of JMS at (2) fails? How can we know and roll back DB? b. What if commit at (3) fails? How do we roll back? Code or sample config example would be helpful. Thanks GM 回答1: You may as well use Spring Data's ChainedTransactionManager for Best

Polling HTTP Service(Outbound Gateway) & process using Transformer in Spring Integration

梦想与她 提交于 2019-12-08 02:15:32
问题 Here is what I'm trying to achieve. Poll an HTTP API once every 15 minutes and process the data retrieved from this. We plan to use Spring Integration. I'm new to this. So with little understanding, I've created an outbound gateway and added poller for the same, but getting the below error. Also, can someone tell me how can I use transformer to process the data from the outbound gateway? Error creating bean with name 'org.springframework.integration.config.ConsumerEndpointFactoryBean#0':

File Inbound Channel unable to read file

 ̄綄美尐妖づ 提交于 2019-12-08 01:59:11
问题 I use Spring Integration to process CSV files manually added to a folder. The beginning of my integration is : <bean id="recursiveScanner" class="org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner" /> <int-file:inbound-channel-adapter channel="filesIn" directory="file:${integration.directory}" scanner="recursiveScanner"> <int:poller id="poller" fixed-delay="${integration.delay}" /> </int-file:inbound-channel-adapter> Followed by custom service activators. When I move a

How is jms session handled in a flow containing inbound adapter, outbound adapter, error channel and configured with same CachingConnectionfactory

给你一囗甜甜゛ 提交于 2019-12-08 00:41:08
问题 I have the following flow: 1) message-driven-channel-adapter -> 1.1) output-channel connected to -> service-activator -> outbound-channel-adapter (for sending response) 1.2) error-channel connected to -> exception-type-router 1.2.1) message is sent to different queues depending on the exception type using outbound-channel-adapter MessageDrivenChannelAdapter uses DefaultMessageListenrContainer and OutboundAdapter uses JMSTemplate Have used same cachingconnectionfactory for inbound and outbound

outbound-gateway with Basic Authentication in spring-integration

我是研究僧i 提交于 2019-12-07 22:48:03
问题 With spring-integration I would like to call an outbound-gateway with an Basic Authentication. I have something like this : <int-http:inbound-gateway id="versionRequestGateway" supported-methods="POST" request-channel="requestVersionChannel" reply-channel="requestTransformerVersionChannel" path="/consultersite" reply-timeout="10000" request-payload-type="java.lang.String"> </int-http:inbound-gateway> <int-http:outbound-gateway order="1" request-channel="requestVersionChannel" url-expression="

Set Spring Integration header value to bean property

你离开我真会死。 提交于 2019-12-07 19:41:23
问题 Is there anyway to set value of spring integration header to bean property. <int:header-enricher> <int:header name="bId" expression="T(java.util.UUID).randomUUID()" /> </int:header-enricher> Now in bean definition <bean id="" class=""> <property name="bId" value="#{headers['bId']}" /> </bean> This above code doesn't work. this throws exception Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'headers' cannot be found on object of type

How-to make an arbitrary part of a message flow (pseudo) transactional?

不想你离开。 提交于 2019-12-07 18:46:41
问题 I would like to make a flow initiated by syslog inbound-channel-adapter messages transactional. Unfortunately the adapter does not take a poller which could be made transactional (the typical approach used in many examples with other inbound adapters). Is there any workaround? EDIT After some thinking I realized that my intent is a little different than initially described (hence change of the title). Basically all I want to do is some simple and straight-forward way of making an arbitrary

Spring Integration TCP inbound/outbound adapter with non-Spring client

倖福魔咒の 提交于 2019-12-07 17:42:38
问题 I'm in the process of designing a system that will run using a Spring MVC web application. It will be used to send and receive TCP commands to and from an existing (non-Spring) application which is used to control some network data filters. I'm just playing around with the Spring Integration TCP stuff (I'm new to SI and Spring in general) to try and understand it but I'm struggling to get a basic example to work. I need the communication to be asynchronous, as the server and client ends could