You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ChrisOwens <ch...@chris-owens.com> on 2015/10/24 00:21:55 UTC

Suggestions for socket listener

I have an application that makes extensive use of EJB and runs in a TomEE
server.  I have a new requirement to listen for UDP broadcast datagrams. I
understand that running a socket listener from a singleton bean is
non-compliant with EJB recommended practices, but I'm not sure what the
cleanest way to implement this is. I have begun to read about JCA adapters
but have not got far yet. I could also run a separate, standalone process
that listens for the datagrams and then emits JMS messages. Do you have any
recommendations?

Thanks,

/c



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Suggestions-for-socket-listener-tp4676581.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Suggestions for socket listener

Posted by "Jonathan S. Fisher" <jo...@springventuregroup.com>.
We had a similar problem: Take events from the Asterisk system and
broadcast them as Topics in ActiveMQ.

Solved it by having an ejb @Singleton @Startup that in a @Postconstruct
method called another @Singleton with a method marked @Asyncronous to
initialize the UDP socket. After that it was fairly simple @Resource
injections to send messages.

We violated some JEE rules along the way but it's extremely simple and it
works :)


On Sun, Oct 25, 2015 at 8:25 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> I d go for a jca connector. Come back to us if you have any issue or
> misunderstanding.
> Le 25 oct. 2015 14:21, "ChrisOwens" <ch...@chris-owens.com> a écrit :
>
> > I have an application that makes extensive use of EJB and runs in a TomEE
> > server.  I have a new requirement to listen for UDP broadcast datagrams.
> I
> > understand that running a socket listener from a singleton bean is
> > non-compliant with EJB recommended practices, but I'm not sure what the
> > cleanest way to implement this is. I have begun to read about JCA
> adapters
> > but have not got far yet. I could also run a separate, standalone process
> > that listens for the datagrams and then emits JMS messages. Do you have
> any
> > recommendations?
> >
> > Thanks,
> >
> > /c
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/Suggestions-for-socket-listener-tp4676581.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>

-- 
Email Confidentiality Notice: The information contained in this 
transmission is confidential, proprietary or privileged and may be subject 
to protection under the law, including the Health Insurance Portability and 
Accountability Act (HIPAA). The message is intended for the sole use of the 
individual or entity to whom it is addressed. If you are not the intended 
recipient, you are notified that any use, distribution or copying of the 
message is strictly prohibited and may subject you to criminal or civil 
penalties. If you received this transmission in error, please contact the 
sender immediately by replying to this email and delete the material from 
any computer.

Re: Suggestions for socket listener

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I d go for a jca connector. Come back to us if you have any issue or
misunderstanding.
Le 25 oct. 2015 14:21, "ChrisOwens" <ch...@chris-owens.com> a écrit :

> I have an application that makes extensive use of EJB and runs in a TomEE
> server.  I have a new requirement to listen for UDP broadcast datagrams. I
> understand that running a socket listener from a singleton bean is
> non-compliant with EJB recommended practices, but I'm not sure what the
> cleanest way to implement this is. I have begun to read about JCA adapters
> but have not got far yet. I could also run a separate, standalone process
> that listens for the datagrams and then emits JMS messages. Do you have any
> recommendations?
>
> Thanks,
>
> /c
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Suggestions-for-socket-listener-tp4676581.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>