Design of a messanging application

HI all,

i am designing a messenging application which has following modules :

UI Module

DB Module

Messenging Module

UI to DB connector

UI to Messenging connector

My problem lies in Messenging module. The purpose this modules is, it should provide a destination for the messages and an interface through which UI components can comunicate with it.

Out of few option i found JMS to be used for Messenging module and developed this component with a Queue through which messages are browsed and retrived. But when the Queue has say, more than 5000 messages then the reponse to the UI is very slower as the whole queue has to be browsed and then some logic is being applied b4 selecting perticular message.

I 've also tried other possibilities in JMS, but the above logic was most fit. Now, i can see the practical limitations with my design.

I need suggestion over the Messenging module desing. Is there any other alternative which can deliver smooth functioning? it may not necessary be a JMS technology.

The purpose of Messenging module in brief: An application component which provide destination (or say storage) for messages and expose an interface for other modules to connect with (e.g. interface contains methods say sendMessage(Message) , receiveMessage() )

WIth best regards.

[1374 byte] By [mackXjacka] at [2007-10-2 10:27:05]
# 1

If your design involves throwing 5000 messages into a big pot and having various applications pick through them to see which messages they should process, then you aren't going to get smooth functioning in any implementation.

Imagine a group of 20 people who get a lot of mail. Do you (a) put all the mail for those 20 people onto a table and ask them to sort through it, or (b) assign somebody to sort through the mail and deliver it individually to the 20 people?

I suspect the problem with your design is that there's only one place for the senders to send messages to, and that place doesn't have any logic for deciding what receivers should process the messages. An alternate design would have one queue per receiver, and the senders would be able to send to whichever queue was appropriate.

DrClapa at 2007-7-13 2:07:31 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
One thing I would be sure to do in a messaging application is be sure to spell 'messaging' correctly.
dubwaia at 2007-7-13 2:07:31 > top of Java-index,Other Topics,Patterns & OO Design...