Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 52e6644

Browse files
committed
dongrade java version from 21 to 17
1 parent 3abd93a commit 52e6644

File tree

5 files changed

+16
-44
lines changed

5 files changed

+16
-44
lines changed

mcp-core/pom.xml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<url />
2323
</scm>
2424
<properties>
25-
<java.version>21</java.version>
26-
<maven.compiler.release>21</maven.compiler.release>
25+
<java.version>17</java.version>
26+
<maven.compiler.release>17</maven.compiler.release>
2727
</properties>
2828
<dependencies>
2929
<dependency>
@@ -60,16 +60,6 @@
6060
<scope>test</scope>
6161
</dependency>
6262

63-
<!-- <dependency>
64-
<groupId>org.springframework.ai</groupId>
65-
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
66-
</dependency> -->
67-
68-
<!-- <dependency>
69-
<groupId>org.springframework.boot</groupId>
70-
<artifactId>spring-boot-starter-test</artifactId>
71-
<scope>test</scope>
72-
</dependency> -->
7363
</dependencies>
7464
<dependencyManagement>
7565
<dependencies>
@@ -80,14 +70,6 @@
8070
<type>pom</type>
8171
<scope>import</scope>
8272
</dependency>
83-
84-
<!-- <dependency>
85-
<groupId>org.springframework.ai</groupId>
86-
<artifactId>spring-ai-bom</artifactId>
87-
<version>${spring-ai.version}</version>
88-
<type>pom</type>
89-
<scope>import</scope>
90-
</dependency> -->
9173
</dependencies>
9274
</dependencyManagement>
9375

@@ -97,14 +79,7 @@
9779
<groupId>org.apache.maven.plugins</groupId>
9880
<artifactId>maven-compiler-plugin</artifactId>
9981
<version>3.12.1</version>
100-
<!-- <configuration>
101-
<release>7</release>
102-
</configuration> -->
10382
</plugin>
104-
<!-- <plugin>
105-
<groupId>org.springframework.boot</groupId>
106-
<artifactId>spring-boot-maven-plugin</artifactId>
107-
</plugin> -->
10883
</plugins>
10984
</build>
11085
<repositories>

mcp-core/src/main/java/spring/ai/experimental/mcp/spec/DefaultMcpSession.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,18 @@ public DefaultMcpSession(Duration requestTimeout, ObjectMapper objectMapper, Mcp
3838
this.transport = transport;
3939

4040
this.transport.setInboudMessageHandler(message -> {
41-
switch (message) {
42-
case McpSchema.JSONRPCResponse response -> {
43-
var sink = pendingResponses.remove(response.id());
44-
if (sink == null) {
45-
System.out.println("Unexpected response for unkown id " + response.id());
46-
} else {
47-
sink.success(response);
48-
}
49-
}
50-
case McpSchema.JSONRPCRequest request -> {
51-
System.out.println("Client does not yet support server requests");
52-
}
53-
case McpSchema.JSONRPCNotification notification -> {
54-
System.out.println("Notifications not yet supported");
41+
42+
if ( message instanceof McpSchema.JSONRPCResponse response) {
43+
var sink = pendingResponses.remove(response.id());
44+
if (sink == null) {
45+
System.out.println("Unexpected response for unkown id " + response.id());
46+
} else {
47+
sink.success(response);
5548
}
49+
} else if ( message instanceof McpSchema.JSONRPCRequest request) {
50+
System.out.println("Client does not yet support server requests");
51+
} else if ( message instanceof McpSchema.JSONRPCNotification notification) {
52+
System.out.println("Notifications not yet supported");
5653
}
5754
});
5855

mcp-spring-boot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<url />
2929
</scm>
3030
<properties>
31-
<java.version>21</java.version>
31+
<java.version>17</java.version>
3232
<spring-ai.version>1.0.0-M4</spring-ai.version>
3333
</properties>
3434
<dependencies>

mcp-spring/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<url />
2323
</scm>
2424
<properties>
25-
<java.version>21</java.version>
25+
<java.version>17</java.version>
2626
<spring-ai.version>1.0.0-M4</spring-ai.version>
2727
</properties>
2828
<dependencies>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<url />
2525
</scm>
2626
<properties>
27-
<java.version>21</java.version>
27+
<java.version>17</java.version>
2828
<spring-ai.version>1.0.0-M4</spring-ai.version>
2929
</properties>
3030
<modules>

0 commit comments

Comments
 (0)