Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

REST webservice -Message reliability/guarantee  RSS feed

 
Arjun Shastry
Ranch Hand
Posts: 1906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Messaging queing systems like Rabbit/ActiveMQ give guarantee and delivery of the messages.Once sender sends a message on queue, its guaranted that message will be delivered to receiver.In developing REST service(or architecture) how message loss is prevented ? REST uses(in most cases) HTTP protocol.Is HTTP load balancer a solution?. As REST call will be synchronous,requester will quickly come to know success or response.
How message loss/message delivery guarantee is done in REST(without using MQ!) ? Is there any away of diing asynchronous processing using REST?
Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to be expecting a lot out of an architecture based on strict use of HTTP methods and standards!

Any of these spiffy features you want will have to be programmed by somebody.

Bill
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Bill is right. REST based on HTTP protocol will be just request-reply with no reliability. I feel it is wrong to compare both asynchronous and synchronous mechanisms. if connection fails just retry again from the client side.
 
Arjun Shastry
Ranch Hand
Posts: 1906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I am thinking of using REST for logging/exceptions. Currently each interface sends JMS message on the queue(logging queue or exception queue).Then queue receiver on other side reads that and does JDBC insert.JMS was chosen as sender interface need not wait for log to be written to DB.Even if DB is down, JMS server is going to store the log messages. To achive this in REST(without using JMS), i think ,workaround is needed. Sender application 'retry if some problem" is not a good thing. Logs/Exceptions are secondary and sender application need not 'waste' their time periodically to check if other system is up.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your REST interaface can accept the log message and send the response that the message is accepted. A background thread can later pick these messages and write it in batch to the database.
 
Arjun Shastry
Ranch Hand
Posts: 1906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I am also thinking of using REST and SocketAppender class.
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SocketAppender.html
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example of how socketappender can be used

http://howtodoinjava.com/2013/04/08/log4j-socketappender-and-socket-server-example/

I dont understand when you say you would use both REST and scoketappender.
 
Arjun Shastry
Ranch Hand
Posts: 1906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
REST for front end where services will communicate and send a log message. From REST to Socket Appender. Only SocketAppender in our network may not work.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks complex and too many hoops.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!