• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to handle queues

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ya'll,
Was wondering if you could help me out with this question. I'm fairly new to development.
How should a send and receive queue be designed for a system that requires sending and receiving of messages?
Do you physically need a database table for both send and receive queues? Or should they be queued in the system's memory? I would assume using a db table would ensure data reliability in the case of a crash.
Also, really, is there a point for a receive queue if messages are processed immediately?
Thanks in advance,
Matt
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting questions! There are so many ways to implement queues ... in memory, in databases, with message oriented middleware (which then has to make the same memory or database choice), queues built into servers, queues built into sockets, etc. There are so many uses ... business process routing, low level event handling inside an application, simulation of real queues (standing in line) and more. You want to pick a couple to talk about? Any of em are bound to be fun and challenging.
 
Matt Kim
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hehe, I'm glad someone's interested about queues!
What if we were to design a message queue. The 2 key points to keep in mind would be 1) throughput and 2) reliability (crash proof).
Here's a question, how does an Internet router handle its inbound and outbound messages?
Matt
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can usually view message queues as pipes. You put stuff in one end, it comes out the other end. Performance and reliability are often a choice rather than getting both. Most messaging products have an option for "assured delivery" that says if you put something into the pipe you can be assured it will get to the other end. If the other end happens to be down at the moment, the middleware stores it to disk or database or something reliable until the receiver comes back on line.
All I can say about Internet routers is that the more I learned (in a single networking class) the more I was amazed that any of it works. Roughly the same experience I had reading Inside OS/2 in the 90s. I mentioned this to a friend at work who said his kid (!) was writing a router in software as a learning experience. Too scary for me.
Gregor Hohpe has a book called Enterprise Integration Patterns that is largely about application level messaging. His site http://www.eaipatterns.com/ has some good info that tends to make you want the book. I wrote a short paper for my team http://www.surfscranton.com/architecture/MessagingPatterns.htm before I saw Gregor's site.
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic