spring-integration
Spring Integration for Enterprise Integration Patterns (EIP) in Spring Boot 3.x. Covers Message Channels, Gateways, Transformers, Routers, Filters, Splitters, Aggregators, Adapters (File, JMS, Kafka, HTTP), and DSL. USE WHEN: user mentions "spring integration", "EIP", "enterprise integration patterns", "IntegrationFlow", "message channel", "gateway", "@MessagingGateway" DO NOT USE FOR: simple REST APIs - use Spring MVC, Kafka only - use `spring-kafka` skill, simple messaging - consider Spring Events
What this skill does
# Spring Integration
> **Full Reference**: See [adapters.md](adapters.md) for File, HTTP, Kafka adapters, Error Handling, and Testing patterns.
## Overview
```
┌─────────────────────────────────────────────────────────────────────┐
│ Spring Integration Flow │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ [Inbound] [Channel] [Transformer] [Channel] [Outbound] │
│ Adapter ──▶ ════════ ──▶ ┌─────────┐ ──▶ ════════ ──▶ Adapter │
│ (File, (Queue/ │ Convert │ (Direct/ (DB, │
│ HTTP, Direct) │ Enrich │ PubSub) Kafka, │
│ Kafka) └─────────┘ HTTP) │
│ │
└─────────────────────────────────────────────────────────────────────┘
```
## Quick Start
```xml
<!-- pom.xml -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-file</artifactId>
</dependency>
```
```java
@Configuration
@EnableIntegration
public class IntegrationConfig {
@Bean
public IntegrationFlow fileProcessingFlow() {
return IntegrationFlow
.from(Files.inboundAdapter(new File("/input"))
.patternFilter("*.csv"),
e -> e.poller(Pollers.fixedDelay(1000)))
.transform(Files.toStringTransformer())
.handle((payload, headers) -> {
System.out.println("Processing: " + payload);
return payload;
})
.get();
}
}
```
---
## Message & Channels
```java
// Message structure
Message<String> message = MessageBuilder
.withPayload("Hello Integration")
.setHeader("contentType", "text/plain")
.setHeader("priority", 1)
.setCorrelationId(UUID.randomUUID())
.build();
// Channel types
@Configuration
public class ChannelConfig {
// Direct Channel (point-to-point, synchronous)
@Bean
public DirectChannel orderChannel() {
return new DirectChannel();
}
// Queue Channel (point-to-point, async with buffer)
@Bean
public QueueChannel processingQueue() {
return new QueueChannel(100);
}
// PublishSubscribe Channel (broadcast to all subscribers)
@Bean
public PublishSubscribeChannel notificationChannel() {
return new PublishSubscribeChannel();
}
// Executor Channel (async with thread pool)
@Bean
public ExecutorChannel asyncChannel() {
return new ExecutorChannel(Executors.newFixedThreadPool(10));
}
}
```
---
## Gateway (Entry Point)
```java
@MessagingGateway
public interface OrderGateway {
@Gateway(requestChannel = "orderChannel")
void submitOrder(Order order);
@Gateway(requestChannel = "orderChannel", replyChannel = "orderResponseChannel")
OrderConfirmation submitOrderAndWait(Order order);
@Gateway(requestChannel = "orderChannel", replyTimeout = 5000)
@Async
CompletableFuture<OrderConfirmation> submitOrderAsync(Order order);
}
@Service
@RequiredArgsConstructor
public class OrderService {
private final OrderGateway orderGateway;
public OrderConfirmation createOrder(CreateOrderRequest request) {
Order order = mapToOrder(request);
return orderGateway.submitOrderAndWait(order);
}
}
```
---
## Integration Flow DSL
```java
@Bean
public IntegrationFlow orderFlow() {
return IntegrationFlow
.from("orderChannel")
// Validation
.filter(Order.class, order -> order.getTotal().compareTo(BigDecimal.ZERO) > 0,
f -> f.discardChannel("invalidOrderChannel"))
// Enrichment
.enrich(e -> e
.requestChannel("customerLookupChannel")
.propertyExpression("customer", "payload"))
// Transformation
.transform(Order.class, order -> {
order.setStatus(OrderStatus.VALIDATED);
return order;
})
// Routing
.<Order, String>route(order ->
order.getTotal().compareTo(new BigDecimal("1000")) > 0
? "highValueOrder" : "standardOrder",
r -> r
.subFlowMapping("highValueOrder", sf -> sf
.handle("priorityOrderHandler", "process"))
.subFlowMapping("standardOrder", sf -> sf
.handle("standardOrderHandler", "process")))
.handle("orderRepository", "save")
.get();
}
```
---
## Splitter & Aggregator
```java
@Bean
public IntegrationFlow batchOrderFlow() {
return IntegrationFlow
.from("batchOrderChannel")
// Split batch into individual orders
.split(BatchOrder.class, BatchOrder::getOrders)
.channel(c -> c.executor(Executors.newFixedThreadPool(5)))
.handle("orderProcessor", "process")
// Aggregate results
.aggregate(a -> a
.correlationStrategy(m -> m.getHeaders().get("correlationId"))
.releaseStrategy(g -> g.size() == g.getSequenceSize())
.outputProcessor(g -> new BatchResult(
g.getMessages().stream()
.map(m -> (OrderResult) m.getPayload())
.toList()
))
.expireGroupsUponCompletion(true)
.groupTimeout(30000))
.get();
}
```
---
## Transformers
```java
@Bean
public IntegrationFlow transformFlow() {
return IntegrationFlow
.from("inputChannel")
.transform(String.class, String::toUpperCase)
.transform(Transformers.toJson())
.transform(Transformers.fromJson(Order.class))
.enrichHeaders(h -> h
.header("timestamp", Instant.now())
.headerExpression("orderValue", "payload.total"))
.channel("outputChannel")
.get();
}
```
---
## Routers
```java
// Header-based router
@Bean
public IntegrationFlow headerRouterFlow() {
return IntegrationFlow
.from("inboundChannel")
.<Message<?>, String>route(m -> m.getHeaders().get("type", String.class),
r -> r
.subFlowMapping("ORDER", sf -> sf.channel("orderChannel"))
.subFlowMapping("PAYMENT", sf -> sf.channel("paymentChannel"))
.defaultOutputChannel("unknownChannel"))
.get();
}
// Payload-based router
@Bean
public IntegrationFlow payloadRouterFlow() {
return IntegrationFlow
.from("orderChannel")
.<Order, OrderType>route(Order::getType,
r -> r
.subFlowMapping(OrderType.STANDARD, sf -> sf
.handle("standardProcessor", "process"))
.subFlowMapping(OrderType.EXPRESS, sf -> sf
.handle("expressProcessor", "process")))
.get();
}
```
---
## Service Activator
```java
@Component
public class OrderHandler {
@ServiceActivator(inputChannel = "orderChannel", outputChannel = "resultChannel")
public OrderResult processOrder(Order order,
@Header("priority") int priority) {
validateOrder(order);
calculateTotals(order);
return new OrderResult(order.getId(), "PROCESSED");
}
}
// DSL equivalent
@Bean
public IntegrationFlow serviceActivatorFlow() {
return IntegrationFlow
.from("orderChannel")
.handle(Order.class, (order, headers) -> {
return new OrderResult(order.getId(), "PROCESSED");
})
.channel("resultChannel")
.get();
}
```
---
## Best Practices
| Do | Don't |
|----|-------|
| Use DSL for readable flows | Build flows with XML only |
| Configure error channels | Ignore errors silently |
| Implement retry with backoff | Fail on first error |
| Use queue channelRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.