Hi Lionel, I've just made several updates to how UDP support is implemented in Apollo. It should be easier to implement a custom protocol handler for UDP now.
The current 'udp' protocol handler [1] is now much simpler and you can probably create your syslog based protocol by copying and modifying that one. I've also added implemented a 'stomp-udp' protocol handler [1] which expects STOMP frames over UDP. It's much more complex since it's doing user auth, virtual host selection, configurable destination parsing, dynamic destination routing, protocol filtering, and configurable header updating. [1]: http://is.gd/boVtNl [2]: http://is.gd/fd5C5M On Mon, Aug 13, 2012 at 3:54 PM, Hiram Chirino <[email protected]>wrote: > Hi Lionel, > > Sorry for such a late reply. Yes, you can plugin a new 'syslog' protocol > to Apollo if you want to handle UDP messages, but you you'd have to > basically copy the current UdpProtocol.scala implementation and adjust to > your needs. Unfortunately it's not exactly trivial. Let me see if I can > think of a way to simplify it a bit more. > > On Mon, Apr 23, 2012 at 2:40 AM, Lionel Cons <[email protected]> wrote: > >> Apollo already has experimental UDP support [1] and this will soon become >> mainstream [2]. >> >> While writing an Apollo plugin to add STOMP support to the UDP connector, >> we >> discovered several issues that would be nice to address. >> >> Although our goal was to restrict STOMP support to SEND frames only, we >> wanted to have something as close as possible to the existing STOMP >> support. >> >> In particular, we wanted to have: >> 1. IP based authentication via >> org.apache.activemq.apollo.broker.security.SourceAddressPrincipal >> 2. additional STOMP headers like <stomp>'s <add_user_header> >> 3. routing based on the destination header >> >> Ideally, this would appear in apollo.xml via something like: >> >> <connector id="stomp_on_udp" bind="udp://0.0.0.0:6163" >> protocol="stomp"> >> <stomp add_timestamp_header="timestamp"> >> <add_user_header >> kind="org.apache.activemq.apollo.broker.security.SourceAddressPrincipal">sender-ip</add_user_header> >> </stomp> >> </connector> >> >> We did not find a way to add this to Apollo (via plugin) and, in our >> experiments, we had to duplicate code in several occasions instead of >> being >> able to re-use it. Maybe it would be better to have UDP being a "normal" >> connector. >> >> Similarly, it would be nice to be able to inject another protocol in >> Apollo >> via a plugin to be able to have something like: >> >> <connector id="syslog_to_message" bind="udp://0.0.0.0:1514" >> protocol="syslog"> >> <syslog destination="/topic/foo"/> >> </connector> >> >> FWIW, this is trivial to do in RabbitMQ [3] and I've been able to add >> syslog >> support there in very few lines of code [4]... >> >> Cheers, >> >> Lionel Cons >> >> [1] >> http://mail-archives.apache.org/mod_mbox/activemq-dev/201203.mbox/%3CCAGZ-RDLF4bWhHU8c+OZZb1_AOmZ-DjfCW9U-HmDP=qv8gar...@mail.gmail.com%3E >> [2] https://issues.apache.org/jira/browse/APLO-177 >> [3] https://github.com/tonyg/udp-exchange >> [4] >> https://github.com/tonyg/udp-exchange/blob/master/src/udp_exchange_syslog_packet.erl >> > > > > -- > > ** > > *Hiram Chirino* > > *Software Fellow | FuseSource Corp.* > > *[email protected] | fusesource.com* > > *skype: hiramchirino | twitter: @hiramchirino<http://twitter.com/hiramchirino> > * > > *blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>* > > * > * > > * > * > > > -- ** *Hiram Chirino* *Software Fellow | FuseSource Corp.* *[email protected] | fusesource.com* *skype: hiramchirino | twitter: @hiramchirino<http://twitter.com/hiramchirino> * *blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>* * * * *
