The Java Magical Service

JMS is like a magical service. Inject a message about a certain topic into a JMS system and other people, who are interested in the same topic, can read the message as well. Maybe not too much magic, but it does work. JMS has basically two types of message channels:

  • Topics – used by publish/subscribe (pub/sub) where the communication can be many-to-many.
  • Queues – used for point-to-point communication.

In both cases the sender and receiver can be decoupled in terms of both space, time and synchronization as described by Eugster et al. in The Many Faces of Publish/Subscribe. JMS also has a hierarchical topic-based publish/subscribe model which is easy to get into. I’ve been working with Apache MQ to implement a simple JMS based publish/subscribe system. The server part of the system is almost functional, but I haven’t started on the mobile client code yet. I’m not quite satisfied with the way the server system processes all the incoming events because the business logic is spread out into several listener classes. My current goal is to find a more convenient way to arrange the logic so that it will be easier to set different policies for the system. I’ll also start writing some code for Android and find out how easy it is to get Android to talk to a JMS based system. Maybe I’ll have to use one of the alternative transports that Apache MQ provides to make it easier.

I’ve done some checking on IEEE 802.1Q and 802.1p (which is rumored to be defined in 802.1G) in regards to the router that might be used in a practical implementation of this system. 802.1p is essentially a standard for providing QoS at the MAC level. It defines eight different traffic classes which are used by 802.1Q. 802.1Q is the Virtual Bridged Local Area Networks (VLAN) standard. In this standard the IEEE has defined a framework called the Generic Attribute Registration Protocol (GARP) for switches and bridges to work with different types of attribute values. GARP is in turn used by a VLAN management protocol called GARP VLAN Registration Protocol (GVRP) which enables you to manage how VLAN configurations are propagated throughout a network of switches (Cisco has a similar proprietary protocol called VTP).

What seems to be the case is that GVRP can only be used to manage switches when there are several connected in a network. According to this article by HP it looks like the first switch must be manually configured. I’m not entirely sure about the technical details, but from what I can tell it doesn’t seem to align with our needs of just configuring one switch and getting it to forward Internet traffic.

Estimated time used for the project the past week: 40 hours

Advertisements

Progress report so far

So far I’ve read a lot of literature about location-based/aware systems and also a few things about publish-subscribe based event systems. The architecture of the system I intend to design is shown as part of a set of slided I made a while ago. I found a way to make the architecture more generic by using a publish-subscribe based system on the home server. Check these PDF files for the original and the new slides.

The original slides were based on the assumption that the mobile phone already knew the status of the alarm system. That isn’t very realistic so the new slides makes use of an event driven system (publish-subscribe) to make the phone aware of the alarm system status. The correct order to read the slides would be to first look at the new slides and then the process continues in the original slides.

I’ve also tried out the Android SDK and written a few small applications to understand how it works. Since there might be better mobile phone frameworks/platforms that can be used I’ve also done some research into other related frameworks/platforms. The disadvantage of Android is obviously that it doesn’t have any supported phones on the market yet, but on the other hand it’s a quite powerful platform compared to some of the others which are already in the hands of consumers.

I estimate that I’ve used about 40 hours on the project the last 7 days. It’s probably a bit more than 100 if you count from when I began and till now. I’ve also put together a project plan which is nice to have.