feat(integration): add Java (Spring Boot) as a full example-based variant#270
Open
sarahxsanders wants to merge 2 commits into
Open
feat(integration): add Java (Spring Boot) as a full example-based variant#270sarahxsanders wants to merge 2 commits into
sarahxsanders wants to merge 2 commits into
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
…iant Add a Java integration variant anchored on a real Spring Boot example app (example-apps/java-spring-boot): the posthog-server client is exposed as a singleton @bean configured from the environment, flushed and closed on shutdown via destroyMethod="close". A controller identifies users, captures events, evaluates feature flags with evaluateFlags, and reports errors as an explicit event (the Java server SDK has no automatic exception capture, documented honestly rather than faked). Ships a full Spring Boot example rather than docs-only so the wizard has a concrete shape to match for the most common Java backend framework. Adds a java-server commandments block, keyed java-server (not java) so these backend rules never fold into the Android skill, which carries the java tag; the variant is tagged [java, java-server]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sarahxsanders
force-pushed
the
posthog-code/integration-java-variant
branch
from
July 23, 2026 19:23
7f36566 to
7dfb504
Compare
evaluateFlags() makes a network call. Wrap it in try/catch so a slow or down PostHog can't 500 the /dashboard page (fall back to the flag off), matching the Elixir example's behavior. Add a note that a real app should cache/bound the call rather than fetch per render. Also document that distinctId must come from an authenticated principal, not an unverified request parameter, so the copied pattern doesn't invite person-property spoofing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sarahxsanders
marked this pull request as ready for review
July 24, 2026 15:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a full example-based Java integration variant (not docs-only), anchored on a real, compiling Spring Boot app at
example-apps/java-spring-boot— the most common Java backend framework, called out specifically in review.What's here:
example-apps/java-spring-boot/—posthog-serverclient as a singleton@Beanconfigured from the environment, flushed + closed on shutdown viadestroyMethod="close". A controller identifies users, captures events, evaluates feature flags withevaluateFlags, and reports errors as an explicit event (the Java server SDK has no automatic exception capture — documented, not faked).gradle compileJavaclean.config.yaml: newjavafull variant, tagged[java, java-server].commandments.yaml:java-serverblock — keyedjava-server(notjava) so backend rules never fold into the Android skill, which carries thejavatag.Ships as a pair with the wizard detection PR PostHog/wizard#948.