dlsniper
dlsniper

Reputation: 7477

Should a message queue server be facing the Internet directly or not?

I have the following use case:

What I would like to know is: how is it better to have the system to ingest the messages?

A) expose the message queue server directly to the Internet, processes the messages later for consistency / validity (of course with a load balancer in front of the servers)

B) expose a server that can read the message in the native format, apply some basic validity checks and then queue the message to an internal message queue server

I'm leaning towards the second option but I have no real arguments for pro / cons of it vs first option so can you please advise on this one?

Thank you.

Upvotes: 0

Views: 881

Answers (1)

Younes
Younes

Reputation: 1671

You question has two parts:

  1. Whether or not to expose the message queue server to the internet
  2. Whether or not to process the message immediately

For the first question, I would advice to put the server behind a firewall. As such, you will have more tools to protect your server against internet attacks.

For the second question, it depends on whether or not the server is required to inform the mobile about the message processing result and whether the result of the message processing should be known immediately:

  1. In case you are not required to send a feedback to the mobile and the result of the message processing is not required to be executed immediately, I would advice to log the message then process later it in batch mode,
  2. In case you are required to send back a feedback to the mobile but the message isn't required to be processed immediately, I would advice to execute a sanity check of the message, send back the feedback to the mobile then log the message for batch processing,
  3. Otherwise, I would advice to execute the sanity check, process the message and send back feedback to the mobile.

In my advice, I have suggested to use batch mode over online mode as much as possible. When you operate in batch mode, you have more options to use efficiently your computing resources in a simple way.

Upvotes: 0

Related Questions