Spring Cloud Stream and Spring Integration
12 questions in 3 subtopics.
Binders
What is a binder in Spring Cloud Stream? Given a function bean namedprocessOrder, which binding names are created and how would you map them to the Kafka topics "orders" and "invoices" with a consumer group?A Spring Cloud Stream consumer using the Kafka binder fails on some messages. Explain what the binder does by default on errors and how you would configure retries and a DLQ.Teams want to use Spring Cloud Stream so they can switch between Kafka and RabbitMQ later. As an architect, when would you accept the abstraction and when would you recommend native Spring Kafka or Spring AMQP?Messaging abstractions in Spring have changed several times (for example the removal of the annotation model in Spring Cloud Stream). How do you judge whether a framework abstraction over brokers is worth it for your company over ten years?Functional model
Write a Spring Cloud Stream functional application that readsOrderPlaced events, emits InvoiceRequested events, and also sends an AuditEvent from a REST controller. Which properties do you need?In Spring Cloud Stream's functional model, how do you compose functions, handle a Function that sometimes should not produce output, and process a reactive Flux instead of single messages? What are the trade-offs of the reactive style?Thirty services still use the Spring Cloud Stream annotation model (@EnableBinding, @StreamListener), which was removed in Spring Cloud Stream 4. This blocks their upgrade to current Spring Boot versions. How would you plan the migration across teams?A team proposes writing all business logic as plain java.util.function functions with Spring Cloud Function, so the same code can run on message brokers, HTTP and serverless platforms. Would you make this a company-wide direction?Spring Integration channels and adapters
Explain the message channel types in Spring Integration (DirectChannel, QueueChannel, PublishSubscribeChannel, ExecutorChannel) and what inbound and outbound channel adapters and gateways are for.Design a Spring Integration flow with the Java DSL that polls an SFTP directory for CSV files, splits each file into lines, filters invalid lines to an error channel, and publishes valid records to Kafka. What would you check for reliability?Several teams run Spring Integration applications for file transfers and partner integrations, and incidents show silent failures and duplicate processing. What operating standards would you set for these applications?Your company has many integration flows built over the years with Spring Integration, an ESB, and custom scripts. How would you decide the future integration strategy: keep embedded integration libraries, use an integration platform, or move to event streaming?No question matches these choices.