Skip to content

[W.I.P.] Add service-registry component (feedback wanted) #474

Closed
wants to merge 1 commit into from

3 participants

@Kami
Kami commented Mar 31, 2013

The goal of this pull request is to add support for registering Respose instances in Rackspace Service Registry.

The patch is unfinished and work in progress. All it currently does it adds a filter which performs the following actions:

  • Register the instance in service registry in init and start heartbeating
  • Stop heartbeating and delete the service on destroy

I opened this pull request to start the discussion and get more feedback from Repose people on how to improve this patch to make it more "idiomatic" and better (best way to add tests, how to correctly use other abstractions such as handler, etc.).

Thanks,
Tomaz

@malconis

Implementing Filter requires the javax.servlet library

Please add:

import javax.servlet.*

to your list of imports

@malconis

The filter chain logic requires that the current filter call doFilter to continue the filter chain.

chain.doFilter(request, response);

@malconis

the getFilterConfig method only really returns the filename of the config file that the user would like to use. Within the system-model.cfg.xml when the user adds a filter to the filter chain they can include a 'configuration' attribute and point to a different config file than the default configuration.

We then pass this to a HandlerFactory which create request handlers whenever Repose receives a request. The ip-identity filter (https://github.com/rackerlabs/repose/tree/master/project-set/components/client-ip-identity/src/main/java/com/rackspace/papi/components/identity/ip) shows the basics of how we expanded the basic Filter methods (doFilter, destroy, and init).

@malconis
Rackspace Hosting member
malconis commented Apr 2, 2013

Hey Kami,

First of all thanks for writing this. This feature looks looks to be a great addition to Repose. I've added some notes to your code, which I hope would help. I would like discuss this with you further to see if I can help get this up and running with Repose soon. Please log in to to our public IRC channel #repose on freenode.net for questions you may have.

@Kami
Kami commented Apr 2, 2013

@malconis Awesome, thank you for your comments.

I will try to get those comments addressed as soon as possible and let you know once the pull request is in a fully working state and ready to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.