spring-integration

How to set parameters on Groovy/Grails InvokeHelper.invokeMethod()

≯℡__Kan透↙ 提交于 2019-12-12 05:59:34
问题 I have a Grails webapp running a Spring Integration inbound-channel-adapter that is configured to receive emails and there is a service activator that processes the message. This service activator pulls out pieces and parts of the email based on business rules and then needs to update Grails domain objects and save those changes to the database. Spring Integration service activator code snippet: HashMap<String, Serializable> params = new HashMap<String, Serializable>(); params.put(

How to set port and connectionFactory during run time for Spring TCP integration

百般思念 提交于 2019-12-12 05:49:28
问题 Basically, I am not aware of port before hand. I will make a REST request to a host to send the port number. I am getting the port number, but not able to move ahead as I am not able to set connection factory into inBoundClient with received port number. Please have a look at the code below, to understand the problem. I have tcp connections defined as below: <?xml version="1.0" encoding="UTF-8"?> <context:component-scan base-package="com.tcpclient" /> <beans xmlns="http://www.springframework

Spring Integration Wrong Host Header

[亡魂溺海] 提交于 2019-12-12 05:49:06
问题 We've been experiencing this weird problem with the request Host header being set as the application's URL. This results to the external system to not handle our requests. Here's the DEBUG log of apache of the Spring Integration application hosted on localhost:8082 . Don't mind the content for now but the Content-Type will be a problem subsequently: org.apache.http.wire - http-outgoing-0 >> "POST /health HTTP/1.1[\r][\n]" org.apache.http.wire - http-outgoing-0 >> "Accept: */*[\r][\n]" org

How to make aggregator wait for response from all methods in publish-subsribe channel?

Deadly 提交于 2019-12-12 05:13:52
问题 I have used the below spring configuration to combine results from publish subscribe channel using aggregator. But the aggregator populates response only from the first service activator in the publish subscribe channel and it does not wait for the response from the other service activators. How should i modify my configuration to make the aggregator wait for response from all 4 service activators? <int:bridge id="ValidationsBridge" input-channel="RequestChannel" output-channel=

Should JmsTransactionManager be used when persisting from one JMS Queue to another JMS Queue

淺唱寂寞╮ 提交于 2019-12-12 05:07:04
问题 Requirement: We need to retrieve a message from a JMS Queue(published by a different application) and persist the message in our JMS Queue. Need the entire flow to be transactional so in case a message cannot be persisted in the downstream JMS queue, message received from upstream JMS Queue should not be acknowledged. My configuration is as below <int-jms:message-driven-channel-adapter id="MessageDrivenAdapter" channel=" jmsMessageChannel " destination="sourceDestination" connectionFactory=

Spring integration: preserve http error code and body in response

允我心安 提交于 2019-12-12 04:38:55
问题 I have an inbound http gateway whose incoming message is passed to an outbound http gateway (using integration java dsl). When the outbound gateway response has http status 200, the outbound response goes back to the caller of the inbound gateway as expected. But when the outbound gateway responds with specific client errors like 423 locked or 403 forbidden, the caller of the inbound gateway receives 500 and a body message that contains an exception as String. I understand that this is

Need spring jdbc resultset to return list of objects instead of LinkedHashMap

霸气de小男生 提交于 2019-12-12 04:36:46
问题 I am using with a row mapper expecting it wuold return me the list of my objects but instead it is returning me LinkedHasMap. I want resultset to be List of my mapped objects. Any idea how can i achieve this ? Config <int-jdbc:stored-proc-inbound-channel-adapter channel="eventObj" stored-procedure-name="p_get_completed_data" data-source="dataSource" auto-startup="true" id="completedEventAdpt" ignore-column-meta-data="true" is-function="false" return-value-required="false"> <int:poller max

Integration test case and file upload

坚强是说给别人听的谎言 提交于 2019-12-12 04:31:28
问题 I wrote some code for related to upload a file using spring, It works fine, Now I am writing integration test cases for that but I am facing some issue My controller method, @RequestMapping(value = "/{attributeName}/upload", method = RequestMethod.POST) @ResponseBody public Result uploadCompany(HttpServletRequest request, @RequestParam MultipartFile file, @PathVariable String attributeName, @RequestParam long dateKey) throws IOException, PromotionException { some code } Test cases @Test

handle 404 error in ws:outbound-gateway

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:59:53
问题 Is there away to handle 404 error in ws:outbound-gateway am using Spring integration 4.3.5 error below, [org.springframework.jms.listener.DefaultMessageListenerContainer] (jmsIn.container-1) Execution of JMS message listener failed, and no ErrorHandler has been set.: org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.ws.MarshallingWebServiceOutboundGateway#0]; nested exception is org.springframework.ws.client

SimpleMessageListenerContainer is continuously consuming after TransactionSystemException

爱⌒轻易说出口 提交于 2019-12-12 03:48:23
问题 I don't want the SimpleMessageListenerContainer to continuously consume the messages when my Transaction marked as rollback. I didn't add listener-container in my configuration file and trying to rethrow the AmqpRejectAndDontRequeueException . It is not working. Here is my codebase: @Transactional public class MySecondService { @Resource private MySecondRepository mySecondRepository; @Transactional(propagation = Propagation.REQUIRED) @ServiceActivator(inputChannel = "my-first-servie-output