Register REST API or other types of APIs in Fabric8

155 views
Skip to first unread message

Tchomir Hadgiev

unread,
Jul 4, 2014, 3:19:13 AM7/4/14
to fab...@googlegroups.com
Hi All, 

we are working on few REST interfaces with Fabric8, however taking a different approach in exposing those. E.g. not using CXF, rather doing our own stuff based on netty.

I've been studying the API registry and particularly the examples which are coming with Fabric8 and all of them are of course based on CXF and it is easy to do it that way. However is there a way to register our own RESt API developed on top of camel-netty component?

Same would apply for any other API based on TCP connections only. For example SMPP, where there is persistent session based TCP connection. 

Another question would be, is there an easy way to use Zookeepers registry for Connection registry where persistent TCP connections ( or session based ones like SMPP ) can be registered and known to the whole cluster - e.g. their state etc...?

Thanks, Tiho

James Strachan

unread,
Jul 4, 2014, 5:39:41 AM7/4/14
to Tchomir Hadgiev, fab...@googlegroups.com
On 4 July 2014 08:19, Tchomir Hadgiev <thad...@gmail.com> wrote:
Hi All, 

we are working on few REST interfaces with Fabric8, however taking a different approach in exposing those. E.g. not using CXF, rather doing our own stuff based on netty.

I've been studying the API registry and particularly the examples which are coming with Fabric8 and all of them are of course based on CXF and it is easy to do it that way. However is there a way to register our own RESt API developed on top of camel-netty component?


You mean register the REST APIs into ZooKeeper so they appear on the API console in fabric8 right? If so sure. Any code can register stuff into ZK at any time. I'm hoping we can automatically detect more kinds of REST endpoints via JMX pattern rules and automatically populate ZK over time. (I'd like us to also expose camel REST APIs as well).

For now you could just write some Java code directly. Another option if you're using the Java container or Tomcat/Jetty/WildFly with the process container stuff is to add a properties file like this which can register stuff into ZK for you...

As an aside; I'd love it if camel endpoints that expose HTTP stuff automatically generated WADL / Swagger metadata so we can automatically add them to the fabric8 API console. 

Claus has been doing some interesting work on defining REST APIs using a DSL inside camel btw...



Same would apply for any other API based on TCP connections only. For example SMPP, where there is persistent session based TCP connection. 

Yeah; we do the same thing with Cassandra for example; to register each node into ZK

we can then inject them into newly created containers:

e.g. something like this ${groovy:zk.matchingDescendantStringData("/fabric/registry/clusters/mythingy") might do the trick

Though that would be a static injection; a nicer more dynamic way to do it is use the gateway for TCP / HTTP load balancing:

then the gateway watches ZK in real time; a process then just needs to register itself into ZK (like in the above properties file).


Another question would be, is there an easy way to use Zookeepers registry for Connection registry where persistent TCP connections ( or session based ones like SMPP ) can be registered and known to the whole cluster - e.g. their state etc...?

Thanks, Tiho

--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James
-------
Red Hat

Twitter: @jstrachan
Email: jstr...@redhat.com
Blog: http://macstrac.blogspot.com/

hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Open Source Integration
Reply all
Reply to author
Forward
0 new messages