Skip to content

Commit 02c328a

Browse files
committed
Fix compilation error in camel-aws-s3
1 parent 42b6093 commit 02c328a

3 files changed

Lines changed: 63 additions & 2 deletions

File tree

components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConfiguration.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
2323
import org.springframework.boot.context.properties.ConfigurationProperties;
2424
import software.amazon.awssdk.core.Protocol;
25+
import software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient;
2526
import software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient;
2627

2728
/**
@@ -113,12 +114,36 @@ public class BedrockAgentRuntimeComponentConfiguration
113114
* etc.
114115
*/
115116
private Boolean autowiredEnabled = true;
117+
/**
118+
* To use an existing configured AWS Bedrock Agent Runtime async client
119+
* (required for invokeFlow which streams events back). The option is a
120+
* software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient type.
121+
*/
122+
private BedrockAgentRuntimeAsyncClient bedrockAgentRuntimeAsyncClient;
116123
/**
117124
* To use an existing configured AWS Bedrock Agent Runtime client. The
118125
* option is a
119126
* software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient type.
120127
*/
121128
private BedrockAgentRuntimeClient bedrockAgentRuntimeClient;
129+
/**
130+
* Enables tracing for the invokeFlow operation. When enabled, the producer
131+
* collects FlowTraceEvent entries and publishes them in the
132+
* CamelAwsBedrockAgentRuntimeFlowTraces header.
133+
*/
134+
private Boolean enableTrace = false;
135+
/**
136+
* The unique identifier of the Bedrock flow alias to invoke (used by the
137+
* invokeFlow operation). Can be overridden per exchange via the
138+
* CamelAwsBedrockAgentRuntimeFlowAliasIdentifier header.
139+
*/
140+
private String flowAliasIdentifier;
141+
/**
142+
* The unique identifier of the Bedrock flow to invoke (used by the
143+
* invokeFlow operation). Can be overridden per exchange via the
144+
* CamelAwsBedrockAgentRuntimeFlowIdentifier header.
145+
*/
146+
private String flowIdentifier;
122147
/**
123148
* Used for enabling or disabling all consumer based health checks from this
124149
* component
@@ -275,6 +300,15 @@ public void setAutowiredEnabled(Boolean autowiredEnabled) {
275300
this.autowiredEnabled = autowiredEnabled;
276301
}
277302

303+
public BedrockAgentRuntimeAsyncClient getBedrockAgentRuntimeAsyncClient() {
304+
return bedrockAgentRuntimeAsyncClient;
305+
}
306+
307+
public void setBedrockAgentRuntimeAsyncClient(
308+
BedrockAgentRuntimeAsyncClient bedrockAgentRuntimeAsyncClient) {
309+
this.bedrockAgentRuntimeAsyncClient = bedrockAgentRuntimeAsyncClient;
310+
}
311+
278312
public BedrockAgentRuntimeClient getBedrockAgentRuntimeClient() {
279313
return bedrockAgentRuntimeClient;
280314
}
@@ -284,6 +318,30 @@ public void setBedrockAgentRuntimeClient(
284318
this.bedrockAgentRuntimeClient = bedrockAgentRuntimeClient;
285319
}
286320

321+
public Boolean getEnableTrace() {
322+
return enableTrace;
323+
}
324+
325+
public void setEnableTrace(Boolean enableTrace) {
326+
this.enableTrace = enableTrace;
327+
}
328+
329+
public String getFlowAliasIdentifier() {
330+
return flowAliasIdentifier;
331+
}
332+
333+
public void setFlowAliasIdentifier(String flowAliasIdentifier) {
334+
this.flowAliasIdentifier = flowAliasIdentifier;
335+
}
336+
337+
public String getFlowIdentifier() {
338+
return flowIdentifier;
339+
}
340+
341+
public void setFlowIdentifier(String flowIdentifier) {
342+
this.flowIdentifier = flowIdentifier;
343+
}
344+
287345
public Boolean getHealthCheckConsumerEnabled() {
288346
return healthCheckConsumerEnabled;
289347
}

components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConverter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class BedrockAgentRuntimeComponentConverter
4242
public Set<ConvertiblePair> getConvertibleTypes() {
4343
Set<ConvertiblePair> answer = new LinkedHashSet<>();
4444
answer.add(new ConvertiblePair(String.class, org.apache.camel.component.aws2.bedrock.agentruntime.BedrockAgentRuntimeConfiguration.class));
45+
answer.add(new ConvertiblePair(String.class, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient.class));
4546
answer.add(new ConvertiblePair(String.class, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient.class));
4647
return answer;
4748
}
@@ -60,6 +61,7 @@ public Object convert(
6061
ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
6162
switch (targetType.getName()) {
6263
case "org.apache.camel.component.aws2.bedrock.agentruntime.BedrockAgentRuntimeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.bedrock.agentruntime.BedrockAgentRuntimeConfiguration.class);
64+
case "software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient.class);
6365
case "software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient.class);
6466
}
6567
return null;

components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpAutoConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2929
import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties;
3030
import org.springframework.context.annotation.Bean;
31+
import org.springframework.context.annotation.Lazy;
3132
import org.springframework.core.env.Environment;
3233
import org.springframework.core.task.SimpleAsyncTaskExecutor;
3334
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -94,8 +95,8 @@ public PlatformHttpEngine springBootPlatformHttpEngine(Environment env, List<Exe
9495
}
9596

9697
@Bean
97-
public CamelRequestHandlerMapping platformHttpEngineRequestMapping(PlatformHttpEngine engine, ObjectProvider<CamelContext> camelContextProvider) {
98-
CamelContext camelContext = camelContextProvider.getObject();
98+
@Lazy
99+
public CamelRequestHandlerMapping platformHttpEngineRequestMapping(PlatformHttpEngine engine, CamelContext camelContext) {
99100
PlatformHttpComponent component = camelContext.getComponent("platform-http", PlatformHttpComponent.class);
100101
return new CamelRequestHandlerMapping(component, engine);
101102
}

0 commit comments

Comments
 (0)