• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Java chat service development  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am looking to develop a internal chat service between the logged in members in my website. I just followed https://www.callicoder.com/spring-boot-websocket-chat-example/ and i am very happy to work with web sockets. But I would like to store the chat conversation in database as well as i want to give an option to file upload and file download , how to do that ? I would like to use Rabbit MQ so that i can put the messages in queue, and now question is how to save the chat in mysql database so that whenever user logs in , i want to show the complete chat history to him.

Is using Stomp with Rabbit MQ is correct or not ? OR shall i have to use the old native socket programming with threads ?

Please advise.

Thanks
Swapna
 
Saloon Keeper
Posts: 5288
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I would like to store the chat conversation in database as well as i want to give an option to file upload and file download


I don't understand the connection keeping the chat history in a DB, and providing a file upload/download facility.

I would like to use Rabbit MQ so that i can put the messages in queue


Where do you see the benefits of using a queue if you intend to store the messages in the DB anyway? That seems a complication for little gain.

question is how to save the chat in mysql database


What difficulties do you see in that? You would need to store the sender, the receiver, the sent date, the received date (possibly null), and the message text - not too difficult from a DB point of view. Adding files would make it a bit more complicated, but not too much.

Is using Stomp with Rabbit MQ is correct or not?


shall i have to use the old native socket programming with threads?


Earlier you mentioned web sockets - is that what you mean by "native" sockets? Both of these questions depend on what sort of client are you using - which you haven't said. Browsers don't support STOMP, correct?
 
Swapna latha
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Stomp allows asynchronous communication in the client side.so in order to store it in database i am thinking of using rabbitmq stomp plugin.
 
Tim Moores
Saloon Keeper
Posts: 5288
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That explains neither what kind of client you intend to use, nor why you think a message queue might be a good choice. Please elaborate on both points.
 
Swapna latha
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:That explains neither what kind of client you intend to use, nor why you think a message queue might be a good choice. Please elaborate on both points.


Hi Tim,

Sorry for late reply. I am planning to use web browser as a client and in future i want to have the app in android too. Using message broker can i store the messages and braodcast when user comes to online ?
 
Tim Moores
Saloon Keeper
Posts: 5288
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A message broker persists messages, so as long as it's up and running you could use one. If you want to offer a message history, you'd need to store the messages independently of that anyway, so a message queue would be a complication without much benefit. I wouldn't use one for this.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!