Atom feeds for enterprise application messaging

janeiro 27, 2008

Atenção, este blog foi migrado para: http://brunopereira.org

In the last months I have studied and worked a lot with web services in general, and more specifically the RESTful ones. I believe we are going through a fast maturation process in this area, and RESTful web services are becoming the preferred choice for many new implementations. Right in the thick of things in this field is the Atom Publishing Protocol. This is the blueprint solution for RESTful web services, and its adoption is growing fast, reaching much broader scope than just blog applications using the Atom Format.The Atom format and AtomPub protocol can both be used for many interesting purposes. This year I’m working on a big refactoring (actually a new implementation) of a widely used Globo.com application. This application (let’s call it Register) is responsible for the creation of new users and provisioning new services to them, among other features.

A nice concept present in the original development is the use of Application Connectors. Through these connectors, other applications get notified of events that happened in the Register application. An example is: when a new subscriber (a paying user) is created, a connector sends the notification to another application in order to create the subscriber’s mailbox in the company’s external mail provider. Another example is: when a user gets provisioned in the blogging service, another connector sends a notification to the blogger application, that does what it needs in order to create the user’s directory and quota on the file server.

Although i like this concept, it currently has some problems. This connector’s invocation is done explicitly by the Register application. The Register application knows that a new subscriber must receive a new mailbox, and it needs to call a given connector to do this. This is my biggest concern with the current implementation. I strongly believe that an application that creates users must not know anything about mailboxes. In the current structure, when a new application ABC must be notified of events in application XYZ, application XYZ must be modified to invoke a new connector. This doesn’t please me at all. Let me explain a solution that pleases me more 😉

To explain my idea, I’ll propose some examples involving Google and its services. As we all know, Google offers several different services, all of which can be accessed using the same Google account. When you register at Google, you receive a mail account. Let’s suppose that Google Register application sends a new entry to an Atom feed every time a new user is created. This way, every user creation is present on the Atom Feed. If an application (for example Google Mail) needs to be notified of the creation of new users, it just needs to subscribe to the Register’s Atom feed.

Let me propose a richer example now. Let’s say Google starts to offer some super cool software development services. If you’re a developer, you can ask them to give you a “development account”. This development account would give you access to a Subversion repository, a Bugzilla project and a MySql database. Each of these would be an independent service offered by them, subject to change at any given time. The activation of “development accounts” could also populate an Atom feed.

This way the Subversion, Bugzilla and MySql services could be subscribers of the feed, doing everything they need when a new development account is activated, in asynchronous manner. The application that activates the development account has no knowledge of any other services. If Google wants to offer new services such as a Maven repository or a Continuous Integration environment, no problem. The new services would just subscribe to the Atom feed and do whatever they need when a new account is activated.

If Google wants to offer a free development account and a non-free account with better features, there could be another Atom feed for the activation of the paying accounts or maybe updates to the same existing feed. The Register application would know only about registrations, and other components could be easily plugged and unplugged from this process, without modifications on the Register application. Ah, and worth mentioning… totally decoupled from any specific platform. I don’t know how to implement any kind of messaging more decoupled than that.

This is much much better than the way our Register application sends notifications currently. And I’ll be pretty happy once we manage to do this, it’ll be so cool!

By the way, these Google’s software development services would be awesome. My friend Bairos kindly provides me Subversion and Trac services, but he doesn’t have Google’s bandwidth 🙂 Let’s hope Google gets to know about this and starts offering these services. It’d be amazing!

Anúncios

Mylyn Trac Connector: accessing web task editor on Linux

janeiro 13, 2008

Atenção, este blog foi migrado para: http://brunopereira.org

My friend Bairos provides me a Subversion repository and a Trac server, and I use both for personal projects.In my job, our issue tracker is JIRA, and I’m using it with Mylyn for several months. However, just recently i started using Mylyn with Trac, in a project I’m developing at home. The Trac server I’m using doesn’t have the XmlRpc plugin, so I’m not able to use Mylyn’s rich task editor with this server, and I faced some problems using the web task editor inside Eclipse on Linux.

Every time i tried to open the task editor, i was getting the following error message: “Could not create Browser page: XPCOM error -2147221164”. I’m not going to detail my analysis of this error, but I was able to fix it installing the packages xulrunner and xulrunner-gnome-support (I’m not sure if both are needed, though).

From my google searches, I could see that this error happens with a lot of applications on Linux, so probably several people using the Trac Connector with the web task editor on Linux faced the same problem. I hope this tip can help.

Just for the records, my environment here is: MEPIS Linux 7.0, Eclipse 3.3.1 with WTP, JDK 1.6.0_03 32 bits, Mylyn 2.2 and Trac 0.10.4


Problema de acesso ao Subversion resolvido

janeiro 13, 2008

Atenção, este blog foi migrado para: http://brunopereira.org

Eu estava com um problema bem chato aqui no meu notebook. Eu utilizo em projetos pessoais o servidor Subversion do Bairos, e eu não estava conseguindo conectar lá a partir do note. Nas primeiras vezes em que isto ocorreu, era um fim de semana e eu achei que o servidor dele estava fora do ar, pois as tentativas de conexão estavam dando timeout.Após verificar com ele que o servidor estava ligado direto, cheguei a pensar que meu plugin do SVN no Eclipse (Subclipse) estava com algum problema. Tentei reinstalar o plugin e fiz até testes com o Subversive também. Nada funcionava. Eu estava achando muito estranho, pois do trabalho eu estava conseguindo acessar o servidor normalmente, com as mesmas configurações do plugin.

Hoje por sorte eu instalei o Limewire aqui no note, e apareceu uma mensagem dizendo que o software havia detectado um firewall na minha rede. Pronto, desconfiei na hora que este era o problema do meu acesso ao servidor. Como estou usando o MEPIS no note em vez do habitual Kubuntu, logo imaginei que as configurações padrão do firewall são diferentes entre as 2 distribuições.

O MEPIS oferece um software chamado Guarddog para gerenciar as regras do iptables, e acessando o mesmo eu pude ver que o tráfego TCP pela porta 81 (utilizada pelo servidor SVN do Bairos) não estava liberado. Criei uma nova regra, liberando explicitamente o tráfego TCP pela porta 81 e pronto, imediatamente consegui me conectar ao Subversion 🙂

Segue abaixo a imagem com a interface do Guarddog, que utilizei para definir a minha nova regra do firewall.

guarddog.jpg

Como eu havia falado: nova distribuição, novos aprendizados. Agora já conheço um software bem amigável para gerenciar o iptables 😉