Successful delivery notification in biztalk filter port - ftp

I have a FTP send port on which I want a successful delivery notification on successful upload of the file. The FTP send port is directly bound to a direct send port in the orchestration, using a filter expression, as I have multiple send ports for that direct send port based on the content of the message.
Is there a way I can achieve a successful delivery notification when the files are successfully uploaded to the FTP location.

You can use Delivery Notifications on the Send Ports. Here's a good blog on the topic: http://kentweare.blogspot.com/2007/11/biztalk-delivery-notification.html
Just keep in mind that this is not Guaranteed Delivery, especially with a protocol like FTP. Basically, you will get the successful ACK if the Adapter sent the message without error. This is not a problem with BizTalk, rather FTP is in no way transactional and anything that goes wrong on the server is out reach of your app.

Related

Send TCP packet to the same source

I want to design a system which reduces travel time of packet what is happening, in reality, am I send an SYN bit from the client side, this bit travel through the router then to server and server reply SYN+ACK which also travel through the router to the client.
So I just want something else like what if the client sends SYN to router, router then send this to server and copy this packet modify SYN to SYN+ACK and send back to client before server can send after server send this SYN+ACK to router, router just accept it(see it as the reply is coming) and discard it.
To achieve above goal, I design a setup in which I have one laptop which sends and receive packet from two ethernet interface and other one is desktop which acts as router(packets are coming and it only forward it to its destination) I set up the routing table from both side and enable the IP forwarding on desktop(which act as router).
All are working fine, on a laptop I have server and client program which send the packet and receive it but the problem is that I want to send the packets to from where it was coming (to source itself) so I modify the packet on routing side using Netfilter module, copy the entire skb(using skb_copy) and interchange its ip source and destination(I did this on NF_INET_PREROUTING) and also interchange the port number but the packet always goes to destination.
What other modification do I need to be done to send the packet to its source itself?
Before all, you have to deal here with some details.
First, on SYN-ACK packet, the server sends its sequence. So if in the router you modify the packet and send back to client, what will be your sequence? It's should be the same like the server will send and the server did not send anything yet.
Second, in the handshake there are several agreements like MSS, SACK enabled etc. So you can't to it on behalf of server.
About the question itself, you should do it in PRE_ROUTING, change the IP addresses and ports, and fix the checksum of both IP and TCP.

grpc unsolicited message from server?

is it possible to create server based unsolicited "events", "messages"
(e.g. message that is NOT a reply to a client's request, but generated
on behalf of the server) in gRPC?
[Tried googling for it, but couldn't find any relevant answer, mind me]
Thanks,
If you want the server to initiate the connection from the server and send a message with no prior interaction from the client, then no, you can't do that with gRPC.
However, this fits perfectly into the "subscriber" pattern that gRPC is intended to support: the client opens a server-streaming request (possibly indicating which messages or events they would like to receive), then the server responds with each message or event as it appears.

Using ZeroMQ to send replies to specific clients and queue if client disconnects

I'm new to ZeroMQ and trying to figure out a design issue. My scenario is that I have one or more clients sending requests to a single server. The server will process the requests, do some stuff, and send a reply to the client. There are two conditions:
The replies must go to the clients that sent the request.
If the client disconnects, the server should queue messages for a period of time so that if the client reconnects, it can receive the messages it missed.
I am having a difficult time figuring out the simplest way to implement this.
Things I've tried:
PUB/SUB - I could tag replies with topics to ensure only the subscribers that sent their request (with their topic as their identifier) would receive the correct reply. This takes care of the routing issue, but since the publisher is unaware of the subscribers, it knows nothing about clients that disconnect.
PUSH/PULL - Seems to be able to handle the message queuing issue, but looks like it won't support my plan of having messages sent to specific clients (based on their ID, for example).
ROUTER/DEALER - Design seemed like the solution to both, but all of the examples seem pretty complex.
My thinking right now is continuing with PUB/SUB, try to implement some sort of heartbeat on the client end (allowing the server to detect the client's presence), and when the client no longer sends a heartbeat, it will stop sending messages tagged with its topic. But that seems sub-optimal and would also involve another socket.
Are there any ideas or suggestions on any other ways I might go about implementing this? Any info would be greatly appreciated. I'm working in Python but any language is fine.
To prepare the best proposition for your solution, more data about your application requirements. I have made a little research about your conditions and connnect it with my experience about ZMQ, here I present two possibilities:
1) PUSH/PULL pattern in two direction, bigger impact on scalability, but messages from server will be cached.
Server has one PULL socket to register each client and get all messages from clients. Each message should have client ID to for server knowledge where send response.
For each client - server create PUSH socket to send responses. Socket configuration was sent in register message. You can use also REQ/REP pattern for register clients (assign socket number).
Each client has own PULL socket, which configuration was sent to server in register message.
It means that server with three clients required to (example port numbers in []):
server: 1 x PULL[5555] socket, 3 x PUSH[5560,5561,5562] sockets (+ optional 1 X REQ[5556] socket for registrations, but I think it depends how you prepare client identity)
client: 1 x PUSH[5555] socket, 1 x PULL[5560|5561|5562] (one per client) (+ optional 1 X REP[5556])
You have to connect server to multiple client sockets to send responses but if client disconnects, messages will not lost. Client will get their own messages when it reconnect to their PULL socket. The disadvantage is requirements of creating few PUSH sockets on server side (number of clients).
2) PUB/SUB + PUSH/PULL or REQ/REP, static cocket configuration on server side (only 2), but server has to prepare some mechanism for retransmit or cache messages.
Server create PUB socket and PULL or REQ. Client register it identity by PULL or REQ socket. server will publish all messages to client with this identity as filter. Server use monitor() function on PUB socket to count number of connected and disconnected clients (actions: 'accept' and 'disconnect'). After 'disconnect' action server publish message to all clients to register again. For clients which not re-register, server stop publish messages.
Client create SUB socket and PUSH or REQ to register and send requests.
This solution requires maybe some cache on server side. Client could confirm each message after get it from SUB socket. It is more complicated and have to be connected with your requirement. If you just would like to know that client lost message. Client could send timestamps of last message received from server during registration. If you need guarantee that clients get all messages, you need some cache implementation. Maybe other process which subscribe all messages and delete each confirmed by client.
In this solution server with three clients required to (example port numbers in []):
server: 1 x PUB[5555] socket, 1 x REP or PULL[5560] socket + monitoring PUB socket
client: 1 x SUB[5555] socket and own identity for filter, 1 x REQ or PUSH[5560] socket
About monitoring you could read here: https://github.com/JustinTulloss/zeromq.node#monitoring (NodeJS implementation, but Python will be similar)
I think about other patterns, but I am not sure that ROUTER/DEALER or REQ/REP will cover your requirements. You should read more about patterns, because each of it is better for some solutions. Look here:
official ZMQ guide (a lot of examples and pictures)
easy ROUTER/DEALER example: http://blog.scottlogic.com/2015/03/20/ZeroMQ-Quick-Intro.html

How to know the socket being used in JMS?

I used client and the client will create a connection to server via HornetQ and Netty
Each of 1 minute, server will send heart beat and client (who subscribered) will be received this message. In the message, I included the root IP of server
Everything will be OK if this server had only 1 network card (NIC).
But in the case, server have 2 or more network cards. I met issue.
In the message is received by client, the IP of server not right.
I used InetAddress.getLocalHost().getHostAddress() to get to root IP and I known it wrong in this case server had 2 NICs
So can you give me some advise, how I can get right IP here?
Some guys said we can refer "the socket being used for getting right IP". Do you know how we can get it?
First of all I don't understand why you need IP address, If you think of implementing heartbeat, its not required, If you have used org.hornetq.jms.client.HornetQJMSConnectionFactory It automatically does heartbeat check. And If you have two servers and want to differentiate between servers, use a clientId and send it in message header and while listening you can select message based on the clientId or other approach use sync jms calls.

Unsolicited notifications from server to client over http

I am working on a dropbox like system and I am wondering how the client gets notified when the files change on the server side. It is my impression that both dropbox and ubuntu one operate over HTTP ports and work as follows:
1. if files change on client machine, inotify detects it and preforms a push from the client to the server. (I get this part)
2. if files change on the server a simple unsolicited notification (just a message saying "time to sync") is sent from the server to the client. Then the client initiates a sync to the server.
I dont really care which language I do this in. I am just wondering how the client gets contacted. Specifically, what if a client is behind a firewall with its own local IP addresses. How does the server locate it?
Also, what kind of messaging protocols would be used to do something like this? I was planning on doing this over HTTP or SSH, but I have no attachment do that.
I'm not sure what Dropbox is using, but it could be websockets (unlikely, it's a pretty new and not widely deployed thing) or more likely a pending Ajax request from the client to the server -- to which the server only responds when it has new stuff for the client. The latter is the common way to implement (well, OK -- "hack";-) some form of "server push" with HTTP.
It took a little research into networking to see how this would work, but it is far more trivial then I expected. I am now using standard Java sockets for this. Start up the server process which listens for a socket connection. Then start up the client which connects to the server.
Once the connection is made, messages can be sent back and fourth. This works through NAT (network address translation) which is standard method for routing packets on private networks behind a firewall.

Resources