ECF / JaxRSProviders

Remote Services distribution provider based upon JaxRS. Includes imples based upon Jersey and CXF.
Apache License 2.0
13 stars 19 forks source link

Bndtools run descriptor #6

Closed yazidaqel closed 6 years ago

yazidaqel commented 6 years ago

Hello, as requested by @scottslewis i'm raising an issue to get an bndtools run descriptor with all needed dependencies. One more item is it possible to update ecfatcentral.maven to include equinox jetty and jetty dependencies

scottslewis commented 6 years ago

Thanks for opening the issue. I've done some work on this as described in the comment here:

https://stackoverflow.com/questions/51254881/osgi-rest-api-service-using-ecf-and-bndtools-is-not-accessible

My plan for tomorrow, July 11 is:

1) Create a new repo and put two bnd projects in it:

org.example.jaxrs.helloworld.api org.example.jaxrs.helloworld.impl

in the .api project will be the interface class HelloWorldService as in the comment. In the .impl project will be the HelloWorldResource as per the comment. Also in the .impl project will be jerserserver.bndrun that was also posted in the comment.

2) Add a org.example.jaxrs.helloworld.consumer project, with a 'HelloWorldConsumer' class.

3) Add a cxfserver.bndrun to the .impl project...that uses CXF (of course)

4) Add a jerseyclient and cxfclient to the .consumer project.

Commit and push all of this to a new repo, so that others can bring into their local workspace, run, modify, etc.

But I first need your permission to use the HelloWorldService and HelloWorldResource classes and put them. Is that OK with you? How would you like to be referred to in the copyright notice in source?

WRT equinox jetty and jetty dependencies in ecfatcentral.maven: the central.maven currently has

org.apache.felix:org.apache.felix.http.jetty:3.4.8

which seems to work fine in my tests. Are you looking for a different version?

scottslewis commented 6 years ago

I've added the following to the bndtools.workspace available here:

https://github.com/ECF/bndtools.workspace

see https://wiki.eclipse.org/Bndtools_Support_for_Remote_Services_Development for install/usage instructions

I've added 3 new project templates

JaxRS Remote Service API template (HelloWorldService) JaxRS Remote Service Impl template (HelloWorldResource) JaxRS Remote Service Consumer template (HelloWorldConsumer)

And I've added 4 bndrun templates:

JaxRS Jersey Server Distribution Provider JaxRS Jersey Client Distribution Provider JaxRS CXF Server Distribution Provider JaxRS CXF Client Distribution Provider

All currently use the Zeroconf (LAN) discovery provider

I think this will help a fair amount for people wanting to do JaxRS Remote Services development with either Jersey or CXF.

Closing this issue.

yazidaqel commented 6 years ago

Hi Scott, Thank you for this detailed answer, This helped me a lot and i think it will help a lot of people. Just i want to mention that when I've been testing I used etcd as a discovery provider and it works. Is it because it wasn't needed in my case?

scottslewis commented 6 years ago

etcd works fine, but the reason I used zeroconf for network discovery in the examples is that etcd requires an external server. I've made a etcd discovery server available at disco.ecf-project.org for these templates (system property), but it can't really be depended upon for public usage for security as well as other reasons, while zeroconf...although limited to LAN-based discovery...generally works for localhost testing (unless disabled by LAN admin...which seems to be becoming rarer). If you are going to use etcd discovery, then please consider setting up your own etcd server as I can't guarantee the reliability/availability of the test one.

In any event, I would like it if I had bndruns templates that use zeroconf, etcd, and other supported discovery providers, but that takes yet more work.