• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Manage multiple UDP calls

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I would like to have an advice for this issue:
I am using Jbos 5.1.0, EJB3.0

I have system, which sending requests via UDP'S to remote modems, and suppose to wait for an answer from the target modem.
the remote modems support only UDP calls, therefor I o design asynchronous mechanism. (also coz I want to request X modems parallel)

this is what I try to do:

all calls are retrieved from Data Base, then each call will be added as a message to JMS QUE.
let's say i will set X MDB'S on that que, so I can work asynchronous. now each MDB will send UDP request to the IP-address(remote modem) which will be parsed from the que message.

so basicly each MDB, which takes a message is sending a udp request to the remote modem and waiting for an answer from that modem.

now here is the BUG:

could happen a scenario where MDB will get an answer, but not from the right modem( which it requested in first place).

that bad scenario cause two wrong things:

a. the sender which sent the message will wait forever since the message never returned to him(it got accepted by another MDB).
b. the MDB which received the message is not the right one, and probablly if it was on a "listener" mode, then it supposed to wait for an answer from diffrent sender.(else it wouldnt get any messages)

so ofcourse I can handle everything with a RETRY mechanisem. so both mdb's(the one who got message from the wrong sender, and the one who never got the answer) will try again, to do thire operation with a hope that next time it will success.


This is the mechanism, mybe you could tell me if there is any design pattren, or any other effective solution for this problem?

Thanks,

ray.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

could happen a scenario where MDB will get an answer, but not from the right modem( which it requested in first place).



But each datagram packet should contain an IP address of the originating machine, right?

I am not understanding your use of the term "modem" - what is really creating packets?

Bill
 
ray frid
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:

could happen a scenario where MDB will get an answer, but not from the right modem( which it requested in first place).



But each datagram packet should contain an IP address of the originating machine, right?

I am not understanding your use of the term "modem" - what is really creating packets?

Bill




Yes, the modem is creating packets automatically, and as we know it should return the answer to the same socket. but there is some bug, sometimes it send the answer to the wrong socket.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yes, the modem is creating packets automatically, and as we know it should return the answer to the same socket. but there is some bug, sometimes it send the answer to the wrong socket.



If the fault is in the "modem" packet creation, and you have no control over the "modems" about the only thing you can do is ignore wrongly addressed packets.

Bill
reply
    Bookmark Topic Watch Topic
  • New Topic