Connect to multiple ftp servers using Spring integration - spring-integration

I have been spring integration, I want to connect multiple ftp server to retrieve files from remote locations, could anyone give me good example how to connect multiple ftp servers using spring integration
Thank you in advance,
Udeshika

The Dynamic FTP Sample explores a technique for creating multiple parameterized contexts on the outbound side. On the inbound side you have to make the context a child of the main context, so that it has access to the channel to which to send the files. This is discussed in this Spring Forum Thread and other threads linked from there.

Related

How to dynamically detect the web-server nodes in a load-balanced cluster?

I am implementing some real-time, collaborative features in an ASP.NET Web API based application using WebSockets and things are working fine when the app is deployed on a single web server.
When it is deployed on a farm behind a software (or hardware) load-balancer, I would like implement the pub-sub pattern to make any changes happening on one of the web servers invoke the same logic to check and push those changes via websocket to the clients connected to any of the other web servers.
I understand that this can be done if there an additional layer using RabbitMQ, Redis or some such pub/sub or messaging component.
But is there a way to use DNS or TCP broadcast or something that is already available on the Windows Server/IIS to publish the message to all the other sibling web-servers in the cluster?
No.
But you can use MSMQ instead of RabbitMQ, but still that's not really going to help as it's a queue and not pub/sub so ignore that.
If it's SignalR you're using there are plenty of docs on how to scale out like Introduction to Scaleout in SignalR
Even if it's not SignalR then you can probably get some ideas from there.

Ftp File polling in Load Balancer

I have created FTP polling using SPring Inetegration (FTP adaptors).Just like to know is there any known issues if i use in the loadbalancer. i.e we have our app deployed in 2 instance of server with LoadBalancer.
Just thinking if File is polled by one FTP Poller and processing and another FTP poller will again poll the same file and process?
For this purpose Spring Integration 3.0 has introduced FtpPersistentAcceptOnceFileListFilter
There is just need to use shared external Persistence MetadataStore - Redis or Gemfire.
Or implement your own, for example JDBC.
And contribute it to Spring Integration - https://jira.spring.io/browse/INT

Right Way to Secure MSMQ over HTTP

We're in the middle of migrating an e-commerce integration from using batching to messaging (MSMQ). The e-commerce application itself is hosted on a web server that is not in our domain. The machine processing orders is in the domain in our LAN. The e-commerce app will write to a local MSMQ when an order is placed. Our order processing component should connect to this queue and read messages from it. We are not using WCF for this.
If it were up to me I'd either ditch MSMQ and go with RabbitMQ or put a vpn client on both machines like Hamachi.
I know that MSMQ can use HTTP as a transport via IIS. However I can't seem to find much documentation on how to set this up securely. Is it as simple as turning on one of the authentication options in IIS? I would prefer to use basic auth as we plan on doing this over HTTPS. After that, how to send credentials from the order processing component?
MSMQ supports HTTP and HTTPS. For details, see http://technet.microsoft.com/en-us/library/cc785272(v=ws.10).aspx
Cheers,
Yoel

Using Service Bus to send messages from a Web Role to all other Web Roles

I’m designing a backend that allows users to establish a TCP socket with it and send/receive stuff along this socket (using a pseudo-protocol I’ve made up) in real-time.
It has to be scalable – i.e. architected on a cloud host. Currently I’m evaluating Windows Azure.
To achieve scalability the application will run on several Web Role Instances. Meaning the users’ TCP sockets will be split across several instances (via a load balancer).
This backend is an event-driven application – when a user sends something to it the message should be passed on to all other connected users.
This means there must be a reliable way to send messages from one Web Role Instance to all other Web Role Instances. As far as I understand, this is what inter-role communication refers to.
Using Service Bus, is it possible for all Web Role Instances to subscribe to a Topic and publish messages to it? Thus implementing the event-driven requirements of my distributed application?
(If not then I’ve misunderstood what this article is about: http://windowsazurecat.com/2011/08/how-to-simplify-scale-inter-role-communication-using-windows-azure-service-bus/)
I wanted to find this out before delving too deep into learning C#, .NET and Windows Azure development.
Thank you for your help.
Yes, using the service bus, all the web roles could send messages to a single topic and each role could have unique individual subscriptions to that topic, such that they all receive the messages sent.
Clemens Vaster has implemented an extension to SignalR using the service bus. It is possible that SignalR + the Service Bus may meet the needs of your project, including the TCP socket implementation.
http://vasters.com/clemensv/2012/02/13/SignalR+Powered+By+Service+Bus.aspx

Communication between 2 web apps running in a azure web role instance

I have 2 web applications running in a web role and I only run single instance in the azure cloud. I would like to send and receive notifications between these 2 applications and any outsider should not have access to them.
That means, web service in both of them are out unless there is a
way to block outsiders from accessing a web service and only a
request from same system would succeed (May be vip and request ip
comparison would do, anything beyond that?).
File system watchers. Create a LocalStorage and use it in both
web apps and watch for files webappA and webappB in each other.
Use Azure Storage Queues.
MSMQ - not interested as its not supported in azure.
Could you please list other options available for me in azure web role
? Thanks in advance.
Note: Please avoid suggesting Internal Endpoint as I am running only a single instance with 2 web applications running in it.
You can set up "private" web services to listen on Internal endpoints. These are not accessible via the outside world. You could have a WebAppOne endpoint and WebAppTwo endpoint, both marked Internal. You then just query the role environment to discover the assigned port for each, and fire up your ServiceHost.
Or... you could use a queue to pass information, as long as:
You're ok with it being asynchronous
You're ok with messages being looked at "at least" once
You're ok with messages possibly being looked at out of order
Or... your apps could write information to an Azure table. No need to expose the table to the outside world.

Resources