Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spring boot demo application version 2.7.18 #14

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Add spring boot demo application version 2.7.18 #14

merged 3 commits into from
Feb 23, 2024

Conversation

KiKoS0
Copy link
Collaborator

@KiKoS0 KiKoS0 commented Feb 23, 2024

  • https://start.spring.io/ by default supports spring boot version 3.x. 3.x is not compatible with Java 8, so we downgraded the generated app to 2.7.18 which is compatible. https://www.marcobehler.com/guides/spring-and-spring-boot-versions
  • We changed the toolchain for inngest-core to Java 8 so that Java 8 apps can consume it. This meant we couldn't use Java httpclient which was introduced in Java 11.
  • We evaluated a couple of Http clients and went with OkHttp because its API resembles the Java 11 Http client the most (Other clients were Google Http client and Apache Http client)
  • The current state is that the app syncs correctly to the dev server but when a function is called it fails on steps execution because of two issues that we'll be looking into next:
  Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: kotlin/enums/EnumEntriesKt] with root cause

java.lang.ClassNotFoundException: kotlin.enums.EnumEntriesKt
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
	at com.inngest.OpCode.<clinit>(Function.kt:26) ~[main/:na]
	at com.inngest.InngestFunction.call(Function.kt:124) ~[main/:na]
	at com.inngest.CommHandler.callFunction(Comm.kt:85) ~[main/:na]
	at com.inngest.springbootdemo.InngestController.handleRequest(InngestController.java:40) ~[main/:na]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) 

Copy link
Collaborator

@albertchae albertchae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paired on this together, there are still some outstanding issues as detailed in the PR description but we figured out enough of the Java 8 compilation that we thought it was worth merging something now

@albertchae albertchae merged commit 26960ad into inngest:main Feb 23, 2024
5 checks passed
Copy link
Contributor

@darwin67 darwin67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.
could you add the command you use to run spring boot server before you merge?

}
}

// NOTE: We probably don't need this singleton anymore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current SDK standards are to no expose any of the handlers to the users, and they can either,

  • mount our route onto their HTTP controller
  • directly create the HTTP endpoint for them

I'd imagine Java will be the former, so the singleton shouldn't exist and only the controller should be there.

@albertchae
Copy link
Collaborator

albertchae commented Feb 23, 2024

looks good. could you add the command you use to run spring boot server before you merge?

we need to figure out this out still 😅 , for now we were just running via IntelliJ

EDIT: #15

implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants