Skip to content

v1.7.0

Latest

Choose a tag to compare

@imfangs imfangs released this 09 Oct 06:27
· 3 commits to main since this release

This release fixes streaming termination and message ID decoding, adds datasource callbacks, and corrects published pipeline handling.

Changes

  • Deliver both Chatflow terminal events (message_end and workflow_finished) in either order.
  • Add the optional onStreamComplete() callback across streaming APIs. It runs after response resources close on normal stream termination; it does not indicate business success.
  • Accept both id and message_id in message chunks while keeping message_id as the serialized field and preserving other event IDs.
  • Add onDatasourceProcessing, onDatasourceCompleted, and onDatasourceError. Datasource results may arrive in multiple pages; a completed page does not end the stream.
  • Preserve existing protected streaming extension hooks and make local regression tests the default build. Real Dify tests require the explicit integration-tests profile.

Upgrade notes

  • Use runPipeline for published pipelines (isPublished=true). It returns a JSON queue receipt containing the batch, dataset, and documents. runPipelineStream now rejects published runs before sending a request; draft pipelines still support SSE.
  • SSE processing now stops on malformed JSON, invalid typed payloads, transport failures, or event callback exceptions, reporting the failure through onException without normal completion. Explicit non-SSE response content types are rejected. Server error and datasource_error events use their corresponding callbacks and do not trigger onStreamComplete().

Compatibility and verification

Java 8 remains supported, with Java 8 API targeting and bytecode. All 51 local regression tests passed on JDK 8, 21, and 26, and binary, source, and Javadoc jars were built on each. CI is configured for JDK 8, 17, 21, 25, and 26.

API contracts were checked against Dify 1.17.1 source. Verification used local fixtures; it does not claim a live Dify integration test.

Installation

<dependency>
    <groupId>io.github.imfangs</groupId>
    <artifactId>dify-java-client</artifactId>
    <version>1.7.0</version>
</dependency>

Thanks to SamizuHM for the Chatflow streaming work in #165.