FAQ Database Discussion Community


how to use filename-regex option in int-ftp:outbound-gateway?

spring,ftp,spring-integration
I defined ftp outbound adapter with ls command and recursive mode in my spring integration project. I want to filter and get files in specified sub-directories. The directory structure on the server is: root ----------a\ ---------------in\ ---------------------a.op ----------b\ ---------------in\ ---------------------b.op I want to get the a.op and b.op files. I...

Spring Integration Async Gateway Response Handling

response,spring-integration,gateway
I need some hint how to solve a problem with Spring Integration. I have a Gateway interface. public interface OrderGateway { Future<Response> process(Request value); } I send a request message via the gateway. The ValidationService should check if the data is correct. If yes it should forward the message to...

Which bean can I use as a alternative one of http-outbound-gateway?

spring-integration
I am changing spring-integration 3.x to 4.x. And I should change every xml configuration to the java file. But, I can't find the bean that can be replaced in place of the followings. <int-http:outbound-gateway url="http://www.google.com/ig/api?weather={city}" http-method="GET" expected-response-type="java.lang.String" request-factory="requestFactory" request-channel="requestChannel" reply-channel="replyChannel"> <int-http:uri-variable name="city" expression="payload"/> </int-http:outbound-gateway> <bean...

Spring Integration with JMS + ActiveMQ: Messages remain in JDBC Message Store after reconnect

java,activemq,spring-integration,spring-jms
I'm trying to configure JMS with Spring Integration and an ActiveMQ Message Broker. My outbound channel should be backed by a JDBC Message Store to prevent data loss e.g. the broker or my application goes offline. My configuration seems to work so far, however the JDBC Message Store does not...

Spring Integration: poll files based on creation date / time

java,spring,spring-integration,enterprise-integration
Using Spring Integration, I need to pick up input messages from a directory. This is a CIFS / Samba shared folder that I only have read-only access to, so I need to find a way to pick up only new files while not needing to delete them. Default AcceptOnceFileListFilter behavior...

spring integration sftp with reactor

spring,spring-integration,project-reactor
This question is sort of continuation of a previous question that I posted. I wanted to create a github project to confirm the behavior and possibly figure out some kind of resolution. Here is the github project Spring support for reactor seems to be included in reactor 2.x versions and...

JAXB marshalling exception; nested exception is javax.xml.bind.MarshalException

spring-integration
I am reading data from the file and validating the number and calling webservice.I am getting following error while calling webservice. [org.springframework.integration.ws.MarshallingWebServiceOutboundGateway] org.springframework.integration.ws.MarshallingWebServiceOutboundGateway#0 received message: GenericMessage [payload=1000213569, headers={timestamp=1432121523488, id=fbdb4e0d-d124-1620-8b41-c8dfea69069c, correlationId=e68bb811-7e9e-b86b-0b28-c24a2e3c02c0, sequenceSize=0, sequenceNumber=2}] 14:32:03.488 DEBUG...

spring-integration-dsl-groovy-http return null when i use httpGet method

spring,groovy,spring-integration
I use spring integration 4.1.4 and spring integration dsl groovy 1.1.0 I included spring integration core, http in dependency. When i am executing spring integration dsl groovy http sample, it throwing null value in console. I am not sure what i missed. Here is my code looks like IntegrationBuilder builder...

Spring Integration - Inbound vs Outbound Channel Adapters

java,spring,spring-integration,enterprise-integration
What is the fundamental difference between inbound and outbound channel adapters? Any examples would be very helpful. I have reviewed the Spring docs and this "directional" distinction is not clear to me. I support an application that has an outbound-channel-adapter configured, but I find the behavior counter intuitive with the...

Is the Spring Integration project inactive?

spring-integration
I'm looking into Spring Integration but the last bibliography I see on the subject is from 2012. It seems as if the project is dead. Is this the case?

Spring Integration | Header Enricher using Java Configuration

java,spring,spring-integration
What's Java config equivalent to following header enricher:- <!-- Business Entity Header Enricher --> <int:header-enricher id="businessEntityHeaderEnricherComponent" should-skip-nulls="false" output-channel="notificationPreferencesInputChannel" input-channel="newUserCreatedChannel"> <!-- Tenant --> <int:header name="tenant" <!-- !! HEADER ENRICHMENT ID DONE BY SPRING MANAGED BEAN !! --> ref="businessEntityPayloadHeaderEnricher" method="extractTenant" /> </int:header-enricher> I have a Spring managed...

how to write output channel from itemWriter in spring batch and spring integration?

spring,ftp,spring-integration
firstly thanks for attention, i combined spring batch and spring integration, i defined a job flow and retrieve files from ftp adapter and sent to jobChannel, and process on it with spring batch , i want to write to output channel and consume the channel after processing, my code is:...

Spring-Integration XML to Java

java,spring,spring-integration
How can I convert this code into Java config? <int-kafka:outbound-channel-adapter id="mainOutboundChannelAdapter" kafka-producer-context-ref="kafkaProducerContext" channel="mainOutboundTopicChanel"> </int-kafka:outbound-channel-adapter> ...

File Poller FileListFilter cast exception

spring-integration
Doing exploratory work before I drink the kool-aid. I am trying to create a simple inbound channel adapter to monitor a directory for new ZIP files. In order to deal with the ever-present "is it complete?" question, I am trying to adapt the example posted here to incorporate a FileListFilter...

MarshallingWebServiceOutboundGateway with JAXB marshaller throws error

java,spring,jaxb,spring-integration
I'm using spring-integration 4.1.2-RELEASE, and am having a bit of problems with a MarshallingWebServiceOutboundGateway. I'm attempting to make a SOAP call to a SOAP webservice, having used JAXB to generate the object representation of the wsdl. My auto wiring and flow looks like this: @Autowired MarshallingWebServiceOutboundGateway securityService; @Autowired HttpRequestExecutingMessageHandler documentService;...

Time-limited aggregation with publish-subscribe in Spring Integration

spring-integration
I am trying to implement the following using Spring Integration with DSL and lambda: Given a message, send it to N consumers (via publish-subscribe). Wait for limited time and return all results that have arrived form consumers (<= N) during that interval. Here is an example configuration I have so...

stub a method in mock bean in spring integration context

java,spring,mockito,spring-integration
I am trying to test a spring integration set up my unit test is as follows, @ContextConfiguration(loader = AnnotationConfigContextLoader.class, classes = { SIContext2Config.class }) public class FileMoverTest extends GenericTest { @Test public void testFileMover() throws InterruptedException { Thread.sleep(1000); int total = 2; int n = 0; for (int i =...

Spring Integration, change udp-outbound-channel port

java,spring,spring-integration
I'm using spring integration to send line of files in UDP. Here is what I'm doing: <int-file:inbound-channel-adapter prevent-duplicates="false" id="filesIn" directory="file:input" channel="inputFiles"> <int:poller default="true" fixed-rate="1000" /> </int-file:inbound-channel-adapter> <int:splitter input-channel="inputFiles" output-channel="output"> <bean class="fr.spring.demo.FileSplitter"> <property name="commentPrefix" value="#" /> </bean> </int:splitter> <int:transformer...

inbound sftp channel adapter custom filter not accepting same file again

spring-integration
I have very simple custom filter for inbound sftp channel adapter where I just check if file extension is in list of accepted or not. If so it returns true and should allow to process that file. What is happening is first time that file is processed it works fine....

Spring Integration - Invoking Methods in Application Code

java,spring,spring-integration,enterprise-integration
I have a outbound-channel-adapter, where the relevant configuration is shown below. <int:outbound-channel-adapter channel="foo-fileChannel" ref="foo-handlerTarget" method="handleFeedFile"> <int:poller fixed-delay="5000" receive-timeout="1000" max-messages-per-poll="10" /> </int:outbound-channel-adapter> <int:channel id="foo-fileChannel"> <int:queue /> </int:channel> <bean id="foo-handlerTarget" class="com.abc.FooFeedHandlerImpl"> <property name="fooDescriptorFile"...

Spring XD source failure handling

spring,spring-integration,spring-xd
I have a stream that includes a module that behaves similarly to the source:file module, with the exception that files will only be detected once using a redisMetaDataStore and Spring Integration's FileSystemPersistentAcceptOnceFileListFilter so that the module remembers what files were already read between container restarts. file-persisting.xml <beans:bean id="redisMetadataStore" class="org.springframework.integration.redis.metadata.RedisMetadataStore" >...

Standalone Spring Boot Integration Java Project

java,spring-boot,spring-integration
I am trying to build a standalone Spring Integration application that has an inbound RabbitMQ based gate way. As the application needs not to handle HTTP requests, I want to make it a runnable Java project (that can be simple run using java -jar). I borrowed this idea after going...

Spring Integration - @Filter discardChannel and/or throwExceptionOnRejection being ignored?

java-8,spring-integration
I have a java DSL based spring integration (spring-integration-java-dsl:1.0.1.RELEASE) flow which puts messages through a Filter to filter out certain messages. The Filter component works okay in terms of filtering out unwanted messages. Now, I would like to set either a discardChannel="discard.ch" but, when I set the discard channel, the...

Which Spring Integration Channel should be used for MQTT

spring-integration,mqtt
I am trying a demo app where we send commands over a UI which then goes through spring integration to deliver a command to a device and gives a command status back to UI, this is my first time using Spring Integration and am a bit unsure of the various...

How to send basicAck to inbound adapter after publisher confirm from outbound adapter

spring-integration,spring-amqp
We have an inbound channel adapter that receives notifications of an event. The complexity of the consumer's criteria restrict our ability to use a simple routing key to distribute the messages, so the application uses a splitter to send that message to interested subscriber's queues via a direct exchange. We...

spring integration vs spring batch [on hold]

spring-batch,spring-integration
We have application where we are receiving file every day and it needs to be parsed and persist in db. File has 5000 record. Should we use spring batch or spring integration? And why? we do need to skip bad record and audit them....

Which library of spring should I use to send emails with multy-threading

multithreading,spring,spring-mvc,spring-integration
I have too many emails. I should write scheduler in order to send messages to them. Messages are different. I use spring framework 4.x. I can write simple class, which connects to SMTP server. But in this case I should write my thread library too in order to send emails...

Spring Integration: SMTP server

java,spring,email,smtp,spring-integration
I am using Spring Integration 4.1.2. In the program flow, at the end of a process I need to send an email. I am using the following: <int:payload-type-router input-channel="response.in"> <int:mapping type="java.lang.String" channel="response.out"/> <int:mapping type="org.springframework.mail.SimpleMailMessage" channel="mail.out"/> </int:payload-type-router> <mail:outbound-channel-adapter channel="mail.out" mail-sender="mailSender"/> This is working fine. I want to also handle the situation...

Sending Message to QueueChannel

spring,jms,spring-integration
My knowledge of JMS is extremely weak so please bear with me. I am trying to send a simple message to a Queue Message Channel. @Autowired private MessageChannel myChannel = null; @Test public void testRecieveMethod() { Message m = ((QueueChannel)myChannel).receive(); System.out.println("HELLO"); } The program hangs like its supposed to but...

Integrating Kafka producer and consumer inside web application

spring-integration,apache-kafka
What is the best strategy to integrate Kafka producer and consumer inside the tomcat web application?' I am using spring-integration-kafka latest release. Thanks I am not able to produce messages in when using the same code inside Spring MVC. However, it works when used in standalone Java Program. 2015-03-06 15:46:46...

spring : adding params for router

java,spring,spring-integration
I'm using spring router to decide which of 2 channels to go through. I wan't to pass to the service that gives back an answer one of the values in the payload and not the payload itself. How can I do that? I didn't really find a use case like...

Handle exceptions caused by message-converter on Message Driven Inbound Channel Adapter

java,spring-integration,spring-jms
In the configuration below I have a message-driven-channel-adapter with a message-converter so the service-activator is invoked with the converted payload. <int-jms:message-driven-channel-adapter id="myConsumerChannelAdapter" connection-factory="connectionFactory" destination="input_queue" channel="input_channel" error-channel="errorChannel" message-converter="messageConverter" header-mapper="jmsHeaderMapper" acknowledge="client" max-concurrent-consumers="10"/> <int:service-activator input-channel="input_channel"...

Serialization error using a jdbc-message-channel

serialization,spring-integration
I'm using a channel backed by a jdbc-message-store but I'm having a serialization error when storing the message. The message payload is a simple String. Here's my config and stacktrace: <bean id="auditMessageStoreQueryProviderBean" class="org.springframework.integration.jdbc.store.channel.MySqlChannelMessageStoreQueryProvider" /> <bean id="auditMessageStore" class="org.springframework.integration.jdbc.store.JdbcChannelMessageStore"> <property name="dataSource" ref="auditMessageStoreDataSource" /> <property...

Spring Integration, catching exception on error channel prevents return

java,spring-integration
I have a set of simple REST services which are all configured with an error-channel to allow a service-activator specified bean to catch exceptions. When an exception does occur, the method in the bean is called, as expected, and I log the exception. However, the caller (i.e. HTTP client) never...

how to run async batch job in batch-int:job-launching-gateway?

spring,spring-batch,spring-integration
Firstly thanks for attention, I combined spring integration and spring batch in my project, i want to launch jobs in asynchronous mode in batch-int:job-launching-gateway, my means is that each message in input channel launch job in asynchronous and not wait util to complete the jobs,my code is: <batch-int:job-launching-gateway request-channel="outboundJobRequestChannel" reply-channel="jobLaunchReplyChannel"/>...

inbound sftp channel adapter file locking issue

spring-integration
I am using sftp inbound channel adapter with custom remote filter. If filter accept that file then it is processed later and deleted fine as i set property "true" for remote delete. Now when my file is not processed successfully and throws exception then i catch that exception and want...

Getting Class cast exception after upgrading Spring Integration version

java,spring,spring-integration
I have a Spring Integration Application which polls for data from AS400 DB picks it and then after some modification transmit it to MQ. It was running fine until I decided to upgrade Spring Integration version. I am getting below error after upgrading from version - spring-integration-core-2.2.3.RELEASE to spring-integration-core-3.0.1.RELEASE. Caused...

@IdempotentReceiver annotation does not work

spring,spring-integration,spring-java-config
I am trying to use the @IdempotentReceiver annotation as mentioned in Spring Integration 4.1.2 reference guide with the following Java Config example (modified to include my logic): @Configuration @EnableIntegration public class IdempotentReceiverConfig { public static class MyPayload { public String transactionId; public String data; public MyPayload(final String transactionId, final String...

Spring Integration RabbitMQ ConnectionFactory gracefully stop retry if RabbitMQ is down

spring,rabbitmq,spring-integration
I have a Configured Spring integration with RabbitMQ as message broker. I have a scenario where the application may be deployed in production with RabbitMQ down.When it happens the application continuosly tries to reconnect org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer run WARNING: Consumer raised exception, processing can restart if the connection factory supports it. Exception...

Why is JSON payload for int-http:outbound-gateway give 400 Bad Request?

json,rest,http,jackson,spring-integration
Why is JSON payload for int-http:outbound-gateway give 400 Bad Request? Below request works fine on Chrome Rest Client with 3 headers specified in inObjgateway and JSON value of Obj public class Obj { @JsonProperty("phone") private String phoneNo; @JsonProperty("orderNumber") private String orderNmb; } Application Context Code Snippet is <int:gateway id="inObjGateway" service-interface="com.XXX.xx.IObjGateway"...

Spring Integration - how to pass parameters into service activator

spring,spring-integration
I want to send an email once an SFTP upload is completed ... I have an SFTP uploader: <sftp:outbound-channel-adapter id="sftpOutboundAdapter" channel="inputFiles" charset="UTF-8" remote-directory="${directory.remote}" session-factory="sftpSessionFactory"> <sftp:request-handler-advice-chain> <bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice"> <property name="onSuccessExpression" value="payload.delete()"/> <property name="successChannel"...

jdbc backed channel on a cluster mode

jdbc,cluster-computing,spring-integration
I want to use the jdbc backed message channel. Reading the doc says that it is supported but after that I found a thread in the forum that explicitly says don't. Could you please clarify me if it's supported? In this case, could you guide me to do so? thanks...

How to keep track of which queue a message came from in a SimpleMessageListenerContainer without a received routing key

spring-integration,spring-amqp
Our application has an amqp inbound-channel-adapter with a listener container where we dynamically add and remove queue names. We would like to utilize RabbitMQ's BCC (Sender-selected Distribution) feature where you set the BCC header to a Collection of recipient routing keys. This would be beneficial to have RabbitMQ distribute the...

spring integration java dsl: how to expand a uri-variable in a Simp destination header

spring-integration
I use a mix of spring-mvc websocket support and spring-integration java dsl. I have an integration flow responsible to send messages to websocket-stomp subscribers using AbstractBrokerMessageHandler. The destination is /topic/notifications/{tenantId} where tenantId is a member of the payload I want to send to subscribers. In spring-integration xml dsl uri-variable subElement....

file-pattern option in int-ftp:outboundgateway not work in recursive mode?

spring,ftp,spring-integration
thanks for attention, i defined int-ftp:outbound-gateway adapter with ls command in my spring integration project, i want to filter recursively .op extension files that in my ftp directories and i set file-pattern to *.op nut not worked, my code is: <int-ftp:outbound-gateway id="gatewayLS" session-factory="ftpSessionFactory" request-channel="inbound" command="ls" filter="ftpFilter" filename-pattern="*.op" remote-directory="" command-options="-R" expression="payload"...

Configure Spring Integration SpEl in java config

java,spring-integration,spring-el
I'm using spring integration to call another service via http. I'm using annotations for configuring spring integration, but I have a problem when I want my service url be configurable based on message payload. Current code looks like this: @Bean @ServiceActivator(inputChannel = "myChannel") public HttpRequestExecutingMessageHandler otherServiceHttpCall() { final HttpRequestExecutingMessageHandler httpHandler...

spring integration jdbc adapter for multiple nodes

spring-integration
I'm using the jdbc inbound-channel-adapter with a typical configuration as below to retrieve records from MYSQL DB. The question is how to make the jdbc inbound-channel-adapter work in a multiple nodes environment? Different nodes will have chance to get one same record to process. I know this may be a...

Would it be better to have 2 inbound channel adapters or 2 queue names on 1 inbound channel adapter

spring-integration,spring-amqp
My application is listening to 2 completely different queues. One queue will have thousands of messages come through it per minute (lets call it q.notifications) and the other will see something like 10 per day (lets call it q.subscriptionUpdates). Would it be advantageous to create 2 <int-amqp:inbound-channel-adapter /> instances or...

Spring Integration 4 - How to set a Gateway's replyTimeout value dynamically?

spring,spring-integration
My Gateway looks like this ... @MessagingGateway public interface MyGateway { @Gateway(requestChannel = "startChannel", replyTimeout = 1000L) ListenableFuture<Boolean> myFlow(); } I use an application.yml file to define some properties which I use throughout my application. One of those is a timeout value. I would like to make MyGateway's replyTimeout parameter...

Spring integration-graph: It is posible to show components within profiles or imports?

spring,spring-integration
I'm used to work with a spring-context.xml with a "beans" root tag, where I write the whole app configuration. That way, I can see integration-graph from STS 3.6.4. Now I want to divide some components of my app for testing purposes. First, I tried to separe the different components and...

spring-integration: Error handling on inbound adapters

spring-integration
Basics: Using spring 4.1.1 with integration, boot and 1.0.0 of the DSL. Multiple inbound SFTP adapters on different schedules fetching files from different vendors. Each integration flow attaches headers to the message after the files are downloaded to identify the vendor source. Use a MessagePublishingErrorHandler to handle exceptions. Standard message...

Spring integration connecting inbound HTTP gateway with outbound Websocket gateaway

spring-integration,spring-websocket
I want to create a REST service to turn on the light. The architecture that I want to have is the following: Many embedded system each is connected to one light instance Each embedded system has a websocket client, that connects to my server My server holds a REST service...

How to eliminate bogus “Referenced bean … not found” warnings in STS?

eclipse,spring,spring-integration,spring-data-jpa,spring-tool-suite
STS (3.6.1 and others), Spring 4.1.x (latest), Spring Integration 4.1.2 In many Spring projects I work on in Eclipse/STS, we have numerous "Referenced bean not found" warnings. These often refer to internal Spring beans/classes, not legitimate mis-configuration of our own beans. Here's an example from one of our Spring Data...

spring-integration poller synchronization-factory in advice-chain

spring,spring-integration
my goal is to let a spring-integration poller back off polling if several exceptions occur. i have the following outbound-channel-adapter configured <int:outbound-channel-adapter id="adapter" ref="handler" method="handle" channel="channel" > <int:poller max-messages-per-poll="50" fixed-delay="13" time-unit="SECONDS" task-executor="threadpool"> <int:transactional synchronization-factory="mySyncFactory" transaction-manager="simpleJdbcTransactionManager" timeout="30"/> </int:poller>...

How to convert Spring Integration XML to Java DSL for errorChannel

spring-integration
I have the below xml configuration in my application and I would like to convert it to the Java DSL. So in this reference I'm explicitly defining the name for the error channel. Mostly for example reason. With this reference what I'm expecting to happen is when a downstream process...

Spring integration FileTailingMessageProducer: Remember current line when restarting

java,spring,spring-integration
We are using the Spring integration FileTailingMessageProducer (Apache Commons) for remotely tailing files and sending messages to rabbitmq. Obviously when the java process that contains the file tailer is restarted, the information which lines have already been processed is lost. We would like to be able to restart the process...

Spring-Integration websocket exception “No adapter for handler SockJsHttpRequestHandler”

spring-integration,spring-websocket
I'm trying to create a websockets server, based on Spring-Integration. I'm using the following configuration file (for now): <int-websocket:server-container id="serverWebSocketContainer" path="websocket"> <int-websocket:sockjs /> </int-websocket:server-container> <int:channel id="receiveMessage"/> <int-websocket:inbound-channel-adapter channel="receiveMessage" container="serverWebSocketContainer" /> <int:service-activator input-channel="receiveMessage" output-channel="nullChannel"...

how to use ExecutorChannel in spring integration?

spring,ftp,spring-batch,spring-integration
Firstly thanks for attention i defined ExecutorChannel and task executor in my spring integration project, for async processing on messages with spring batch, as bellow : <bean id="ftpSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"> <property name="host" value="${ftp.server.ip}"/> <property name="port" value="${ftp.port}"/> <property name="username" value="${ftp.username}"/> <property name="password" value="${ftp.password}"/> <property name="clientMode"...

Spring integration xml file errors out on reactor StringUtils

spring-integration,project-reactor
I have a spring integration sftp flow which I load as a child context within my overall application context. This is based on the dynamic ftp SI example. My integration flow has nothing about reactor or streams in it. Its a simple flow with one direct channel connected with a...

How to concatenate a string with SpEL in SpringXD Stream Definition

spring-integration,spring-el,spring-xd
I'm trying to create a stream definition that uses two payload fields joined together to create a concatenated string. stream create --name blah --definition "http | gemfire-json-server --keyExpression=payload.getField('deviceId') + payload.getField('timestamp')" --deploy` The concatenation piece in the keyExpression is incorrect, what should it be to get it to work inline?...

Limit accept type and charset on http inbound gateway

spring-integration
Is there a way to limit the type of messages that can be received using a http-inbound-gateway? In particular, accept and accept-charset http headers thanks in advance Guzman...

pass query to execute to a jdbc component

spring-integration
How can I have a jdbc channel adapter of gateway to execute a query that is passed through input message or its properties. Not sure if there a way to use query this way. So instead of below <int-jdbc:outbound.. query="select * from ...." ... I would like to have something...

Does Spring integeration kafka support dynamic topic creation

spring,spring-integration,apache-kafka,kafka-consumer-api
I am a newbie to spring integeration kafka and I understand kafka-oubound-channel adapter. But is there a way i can create topics progamattically without having to setup in context xml? ie: based on my message to transformer i would like to post message to kafka topic created for this message...

Spring-integration scripting with Python

python,spring-integration,jython
I'm trying to use Python with spring-integration and jython-standalone-2.7.0: Here is my application context: <int:inbound-channel-adapter id="in" channel="exampleChannel" > <int:poller fixed-rate="1000" /> <int-script:script lang="python" location="script/message.py" /> </int:inbound-channel-adapter> <int:channel id="exampleChannel" /> <int-ip:udp-outbound-channel-adapter id="udpOut" channel="exampleChannel" host="192.168.0.1" port="11111" /> Here is my script in Python: print "Python"...

How to catch socket exceptions on TcpInboundGateway?

java,spring,sockets,spring-integration
I'm using TcpInboundGateway from spring-integration for a socket client. In TcpInboundGateway.doOnMessage() the stream is send via the socket connection. If an exception occurs eg because the socket is closed, there is just a spring error log "Failed to send reply". BUT I'd like to handle those socket errors explicit. How...

Maximum simultaneous connection when using ftp adapter

ftp,spring-integration
What can I tweak to solve this maximum connection problem? Any ways to specify a limit? This is from a Spring Integration application. <int-ftp:outbound-channel-adapter id="matasLiveProdSdkOutbound" channel="ftpOutboundChannel" session-factory="ftpsSessionFactory" charset="UTF-8" auto-create-directory="true" use-temporary-file-name="false" remote-file-separator="/" remote-directory-expression="${egnyte.remote.dir}" mode="IGNORE"> </int-ftp:outbound-channel-adapter> This is the error I get: Caused by:...

Sending mail with a custom MIME Message using Camel

java,email,apache-camel,spring-integration
I want to send a multipart MIME message (custom headers, plain text and HTML) using Camel. I can see in the source code that if I send a javax.mail.internet.MimeMessage in the body of a Camel message to the mail component, it send it without creating a new one. But in...

How to: Implement a BatchMessageListenerContainer for bulk consuming a JMS queue

performance,jms,spring-integration,bulk,consuming
I recently faced the need for a JMS consumer in Spring Integration - capable of consuming burst of high volume without stressing my target Oracle database with too many commits. The DefaultMessageListenerContainer does not seem to support anything but message by message transactions. I googled for solutions and found a...

Is there any workaround for using channel name with dash character using spring integration 4 without xml?

spring-integration
I upgraded my spring integration 3.x to 4.x. And I removed all xml configuration and replace to java annotation in pojo files. But the problem is.. I want to use the channel name with '-' character. It is very good to recognize and distinguish each words in name. Besides, if...

having spring integration tcpserver to manage clients and send them messages

java,tcp,spring-integration
I have already created a simple tcp server with spring integration which keeps a connection alive and responses to each request during the connection. In that requestMethod, I'm also able to read the MessageHeder to get the connectionId. Now I want to send messages from the server to the client....

local-dir alias in configuration file

spring-integration
Where can I find the documentation which says what "file:local-dir" is an alias for in the xml configuration files ? This notation in for example used in the int-sftp:inbound-channel-adapter sample files....

Spring Integration Java DSL - @ServiceActivator method with @Header parameter annotations

java-8,spring-integration
I have a Spring Integration 4 bean method with the following signature: @Component public class AService { @ServiceActivator public Message<?> serviceMethod( Message<?> message, @Header(ServiceHeader.A_STATE) AState state, @Header(ServiceHeader.A_ID) String id) { ... } ... } At the moment, I call this service method from within a Spring Integration Java DSL (spring-integration-java-dsl:1.0.1.RELEASE)...

Spring Integration with RESTEasy

jboss,spring-integration,resteasy
In our existing integration, we are planning to replace Queue ( the entry point to our integration processing) with RESTEasy services. We are processing the HTTP requests as below: 1) Asynchronous HTTP Request Processing for GET 2) Asynchronous Job Service for POST I understand that spring integration provides and for...

Limit the output of jsch in Spring integration

log4j,spring-integration,slf4j,jsch
I am trying to limit the output of the com.jcraft.jsch package in my Spring Boot applicatoin. My application uses Spring Intgration and has a log4j.properties files defining the following log levels # Root logger option log4j.rootLogger=DEBUG log4j.category.com.jcraft.jsch=ERROR log4j.category.org.springframework.integration.file=ERROR And still, I get a whole lot of INFO levelled messages from...

Spring integration Splitter task execution

java,spring-integration,splitter
I'm working on a Spring Integration application. I have an inbound channel adapter that read a directory Then a splitter that split the File into lines Finally an udp outbound channel adapter that sends the lines <int-file:inbound-channel-adapter prevent-duplicates="false" id="filesIn" directory="file:input" channel="inputFiles" /> <int:splitter input-channel="inputFiles" output-channel="udpChannel_11111" expression="T(org.apache.commons.io.FileUtils).lineIterator(payload)" /> <!-- Define UDP...

Spring Integration - including payload in errors

spring,spring-integration
I'm trying to include the inputMessage payload in errors, but it seems it's never being passed on and enriching doesn't seem to work either. I have a directory polling service: <file:inbound-channel-adapter id="incomingFiles" auto-startup="true" auto-create-directory="false" channel="myFiles" filename-pattern="${directory.local.pattern}" directory="file:${directory.local}"> <int:poller id="poller" fixed-delay="${directory.local.poll}"/> </file:inbound-channel-adapter> These files are then being uploaded via SFTP:...

Delete File after successful persist to MongoDB in Spring Integration

spring,mongodb,spring-integration
I have a Spring Integration flow that reads a csv file from a directory, splits the lines, then processes each line and extracts 2 objects from each line. These two objects are then send to two seperate int-mongodb:outbound-channel-adapter. I want to delete the incoming file after all of the lines...

Error handler not being invoked for sftp outbound adapter

spring,spring-integration
I would like to be able to catch any exceptions that are thrown by the int-sftp:outbound-channel-adapter while uploading files to the sftp server. I was expecting that by simply specifying int:service-activator to use errorChannel as input I will be able to capture any and all exceptions thrown by my sftp...

How to set up XML marshalling for a TCP server in Spring integration?

spring-integration
I want to use spring integration to create a simple TCP server that communicates using XML messages. I trying to use a TcpInboundGateway with appropriate marshalling set up on the input and output channels as below. @Bean TcpNetServerConnectionFactory cf () { TcpNetServerConnectionFactory tcf = new TcpNetServerConnectionFactory(7017); tcf.setSerializer(new ByteArrayLfSerializer()); return tcf;...

Send Mail using Spring MVC

spring,spring-mvc,spring-integration
I have a custom MailDto object in which I set the to,cc, bCc field and send it using RestTemplate to Spring MVC controller as below @RequestMapping(value = "/SendMail" ) public ResponseEntity<String> SendMail( @RequestBody MailMessageDto mailDto) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException From the controller I invoke the Gateway (Spring integration). The...

How to implement this TCP stream reader in Spring Integration?

java,spring,tcp,streaming,spring-integration
I would like a Spring Integration implementation of a stream reader. Another application (outside of java) sends streams of data (delimited by dollar-signs) to port 9999. This server listens. First I made sure the stream was streaming by connecting to it with telnet 127.0.0.1 9999. Then I created a simple...

What is the correct way to make use of correlated messages for TcpOutboundGateway connection to a legacy server

java,spring-boot,spring-integration
My understanding is that TcpOutboundGateway is correlating a tcp request and response, but I am not sure how to use this. The snippet below sends a message via a TcpOutboundGateway to communicate with a legacy system. message = new GenericMessage("ccs?cmd=5&itm="+(16600+t)+"&rf=2"); Test.sendChannel.send(message); // sendChannel is a DirectChannel. //Blocks here until reply...

Return last value query in MongoDB in Spring XD Source module

mongodb,spring-integration,spring-xd
I would like to be able to create a query/query-expression that I can use in SprinXD MongoDB Source module to return only the last document that has been inserted. It seems that max-messages-per-poll doesn't do the trick (paginated data with the help of mongo inbound adapter in spring integration) I...

how to move processed file to another directory using Spring integration ftp inbound adapter

spring,ftp,spring-integration
I am trying to poll local directory using ftp inbound adapter to fetch files for further processing. I want to move file to another local directory and delete file from origination. Not getting a way to achieve it. plz help <int-ftp:inbound-channel-adapter id="ftpInbound" channel="ftpChannel" session-factory="ftpClientFactory" filename-pattern="*.xml" auto-create-local-directory="false" delete-remote-files="false" remote-directory="/" local-directory="//C://FBS//testmq"> <int:poller...

Spring Integration input file adapter - Where/when should file contents enter message payload?

java,spring,spring-integration
I'd started a Spring Integration project using a file-based inbound-channel-adapter and so far it's working well. But I realized that I don't seem to have implemented the concept correctly and would like to seek some advice here on how to correct it. In the Spring XML declaration, the adapter is...

Spring integration annotation Java 8 Optional Incorrect Handling

java,spring,java-8,spring-boot,spring-integration
I am using Spring boot 1.2.2.Release and Java 8, the problem is that Spring is wrapping Optional payload into new Optional objects as many times as I am passing it through transformer/service activator. E.g. @ServiceActivator(inputChannel = ..., outputChannel = ...) public Optional<Foo> transform() {returns -> Optional.of(foo);} @ServiceActivator(inputChannel = ..., outputChannel...

Publisher should wait till broker is available

spring,jms,spring-integration,spring-jms
I have a simple publisher, which sends messages to a queue. <int:channel id="publishChannel"/> <int-jms:outbound-channel-adapter channel="publishChannel" destination="testQueue" session-transacted="true"/> @Publisher(channel = "publishChannel") public String sendMessage (String text) { return text; } If the broker crashes, the publisher throws an MessageHandlingException. Is it possible to block the publisher, till the broker is available...

Continuing with Spring integration flow after SoapFault

web-services,spring-integration,soapfault
Our application integration flow is defined as splitter -> ws gateway -> aggregator The splitter splits request into a list of account numbers; so that for each account number a web service call is initiated and the responses from multiple web service calls are aggregated in the aggregator.The channel between...

spring integration wire-tap and logging-channel-adapter logging issue

spring-integration
I am trying lo add wire-tap to intercept the channel but it is not using my logback configuration but instead it uses org.apache.commons.logging.impl.Jdk14Logger. How do tell LoggingHandler.messageLogger to use lmy logback configuration? <int:channel id="testChannel"> <int:interceptors> <int:wire-tap channel="loggerChannel"/> </int:interceptors> </int:channel> <int:logging-channel-adapter id="loggerChannel" level="DEBUG"/> My logback has following configurayion defined <logger name="org.springframework"...

can a jms inbound gateway reply include all messages of a message sequence

spring-integration
I have a jms-inbound-gateway that reads requests from a WebsphereMQ broker and passes them though my integration system which returns a message sequence as reply. The message sequence is obtained by applying the splitter on a collection. It generates 63 messages as shown in the log. The problem is that...

Error while sending message to turn on Spring Integration inbound adapter using ControlBus

java,spring,spring-integration
This is my first attempt using ControlBus to turn inbound channel adapters on/off. To make it simple, I'm sending my control message by writing an empty file into a directory watched by a inbound file adapter (this one is perpetually turned on), which I then route to a service activator...

Failure to remove a file using an outbound-gateway

spring-integration,jsch
Im trying to use an sftp outbound gateway to delete a specific log file on a remote sftp. <int-sftp:outbound-gateway id="removeSourceGateway" session-factory="sftpCachingSessionFactory" reply-channel="outputChannel" request-channel="afterSuccessBackupChannel" requires-reply="false" command="ls" expression="'/export/logs/'" remote-directory="${sftp.remote.dir}"> </int-sftp:outbound-gateway> If I execute a LS or PUT command in the configuration above, then I get the expected content - see below for...

how should a message look like to be a response

java,tcp,spring-integration
I have read and followed the example in http://docs.spring.io/spring-integration/reference/html/ip.html#ip-correlation I have a spring-integration server <int-ip:tcp-connection-factory id="socketserver" type="server" port="30124" using-nio="true" mapper="mapper" deserializer="jsonSerializer" serializer="jsonSerializer" single-use="false"/> with this mapper from above link: <bean id="mapper" class="org.springframework.integration.ip.tcp.connection.MessageConvertingTcpMessageMapper"> <constructor-arg...

Spring integration - need immediate response from webservice gateway with asynchronous processing in backend

java,web-services,asynchronous,spring-integration
We have a requirement where the external client are calling one of our spring integration inbound webservice gateway and we need to acknowledge them right away with a generic OK status. Meanwhile, the payload will be submitted to a channel for asynchronous processing and we don't need the response(email will...

Syntax error on tokens, delete these tokens - kafka spring integration demo application

java,eclipse,spring-integration,apache-kafka
I am trying to use the demo application for spring kafka integration and getting an "syntax error on token, delete these token" error in eclipse. looks to be simple one, but i dont know how to fix. errors at return args -> @Bean @DependsOn("kafkaOutboundChannelAdapter") CommandLineRunner kickOff(@Qualifier("inputToKafka") MessageChannel in) { return...

Spurious error “Cannot correlate response - no pending reply” using TcpOutboundGateway and CachingClientConnectionFactory

java,multithreading,spring-boot,spring-integration
I am getting spurious correlation errors using TcpOutboundGateway with CachingClientConnectionFactory in a multithreaded context. The log message is: 2015-05-26 14:50:38.406 ERROR 3320 --- [pool-2-thread-2] o.s.i.ip.tcp.TcpOutboundGateway : Cannot correlate response - no pending reply I do not get the error when sending from a single thread, and I have tested and...

messagebased RPC with topic

spring,jms,spring-integration,messaging,spring-jms
A simple message-based RPC is very easy to create. The server side exports the service, the client side uses a proxy. What is the best way, to make the same thing with multiple repliers? I want to send a request from a client. Then the client waits while all (maybe...

combine spring batch and spring integration?

spring,ftp,spring-batch,spring-integration
thanks for attention,i defined a combine spring batch and spring integration project and communicate with ftp server to retrieve file and process on it and write on ftp, i am looking for a good architecture for my project, i designed an architecture with spring integration as bellow diagram: when retrieve...

Spring Integration and returning schema validation errors

spring,spring-integration,json-schema-validator
We are using Spring Integration to process a JSON payload passed into a RESTful endpoint. As part of this flow we are using a filter to validate the JSON: .filter(schemaValidationFilter, s -> s .discardFlow(f -> f .handle(message -> { throw new SchemaValidationException(message); })) ) This works great. However, if the...

spring-integration perform ftp from various source

spring-integration
Is it possible to download files from various source directory of multiple servers via spring-integration channel adapters. To be more clear, I have situation Server A Dirs A,B,C,D I need to download it in P,Q,R,S dirs on client and after successful download remove source dirs. Is that possible via JAVA...