fdk-java icon indicating copy to clipboard operation
fdk-java copied to clipboard

Spring Cloud Function support

Open mjg123 opened this issue 7 years ago • 5 comments

Try to get this ready in time for SpringOne.

  • [x] This needs to be a separate jar
  • [x] Need to be able to supply a FunctionInvoker from a separate jar
  • [x] SCF support
  • [x] Example Project
  • [x] Blog post

mjg123 avatar Nov 27 '17 11:11 mjg123

If you're going to be at SpringOne we should definitely talk about the best place to host fn support for Spring Cloud Function. If you need to make changes there, irrespective of where we host the adapter, please get in touch (or send PRs).

dsyer avatar Nov 27 '17 13:11 dsyer

@dsyer I'll be there Monday. Would be great to discuss. Spring is a priority integration target for us.

carimura avatar Nov 27 '17 17:11 carimura

Thanks @dsyer! I'll have something useable in-tree soon, then we can discuss more based on that.

mjg123 avatar Nov 28 '17 16:11 mjg123

This is in the latest released version. See https://github.com/fnproject/fn-spring-cloud-function-example

A few of things left to do:

  • [ ] Input coercion of JSON objects is not working - we always get LinkedHashMap
  • [ ] Some configurations cause Spring to act in ways which are prohibited by our JDK9 setup (which doesn't specify --warn-on-illegal-reflection type arguments atm) Needs investigation to see what actually triggers it and whether we can fix it in a better way than just allowing all the things which Jigsaw prevents by default.
  • [x] Errors when none of the Spring Beans is a possible function are badly handled (NPE). Better error messages is the best we can do here, though.
  • [ ] NPE when your function bean returns null
  • [ ] need to have an unused method to define the entrypoint: #113

mjg123 avatar Dec 04 '17 14:12 mjg123

Hi, i had a problem that when i test a function such as uppercase or lowercase after fn routes configured successfully, the docker container will always be built eachtime when i send a request. And the container will be destoryed when the request finished. Compared with fn-spring-cloud-function, the original fn function ensures that the container will always exist until time out for no request comes in. Thanks a lot.

gu6161 avatar May 31 '18 05:05 gu6161