davsclaus opened a new pull request, #28024: URL: https://github.com/apache/camel/pull/28024
Third part of CAMEL-25736: YAML examples for 27 components whose documentation had none. `camel_catalog_sample` reads its samples from the documentation, so it had nothing to give for them. The components: amqp, caffeine-loadcache, consul, controlbus, cql, disruptor-vm, ehcache, ftps, jmx, ldap, ldif, mock, pgevent, rest-api, saga, scp, smb, spring-event, spring-jdbc, spring-ldap, spring-redis, sql-stored, stax, stub, validator, vertx and webhook. ## What - A Java example of a route gets a YAML tab next to it. Test code (MockEndpoint assertions, ProducerTemplate calls) and Java setup code stay Java-only. - A page without a route example gets a short Usage section with one. - Every example was checked in the code of the component. Most were run with `camel run`, with `camel infra` for the servers (Postgres, Cassandra, OpenLDAP, Samba, an SSH server, Artemis, Consul and Redis). ## What the runs found in the pages - **sql-stored:** the values of the OUT and INOUT parameters are in a `Map` in the message body, or in the header that `outputHeader` names. The page said each one goes in a header of its own name. - **ldif:** a body that is not LDIF is read as a URL only when `allowUrlBody` is set. The result of an entry is `success`, not `_success_`. The Java example did not compile, and its description was copied from the ldap page. - **stax:** the JAXB classes imported `javax.xml.bind` instead of `jakarta.xml.bind`, and the sample XML closed the wrong element. - **ehcache:** the idempotent example used an undefined variable. The page now also says that without a shared cache manager each endpoint has its own cache, and that the default cache sends no events. - **smb:** the consumer reads the same files again on every poll unless `move`, `delete` or `noop` is set. The page now says so. - **spring-jdbc:** in a Spring transaction, `resetAutoCommit` must be `false`. By default, the component commits and closes the connection itself. - **spring-redis:** by default, keys and values are stored with Java serialization, so other Redis clients do not find them. The page shows `StringRedisSerializer`. - **spring-ldap:** the `LdapContextSource` bean needs `afterPropertiesSet` as its init method. - **rest-api:** the API document needs camel-openapi-java on the classpath. - **webhook:** when the application has more than one REST component, `webhookComponentName` chooses one. The catalog copies of the 27 pages are updated with them. ## Two fixes the runs found in the components - **camel-ldif** could not connect unless the user added a dependency. The LDAP client loads its codec by class name from `api-ldap-codec-standalone`, which had test scope. It is now a dependency of the component. At runtime it adds two jars, `api-ldap-codec-standalone` and `api-ldap-net-mina`, at the version the Camel parent pins. - **camel-consul:** the enum of the `action` option had five actions of the agent API. The catalog and the validator rejected `consul:kv?action=PUT`, which works. The enum now has the 35 actions of the nine APIs, and the description says which actions belong to which API. `ConsulActionEnumsTest` keeps the enum in step with the action constants. The endpoint DSL, the component DSL and the catalog are regenerated. ## Checks - Every new example passes `camel_validate_source`. - Run with `camel run`: 25 of the 27 pages. Not ftps: the FTPS server of `camel infra` fails the TLS handshake. Not spring-event: it needs a Spring ApplicationContext. - On a full reactor build, the tests of camel-catalog (1101), camel-yaml-dsl-validator (240), camel-jbang-core (2505) and camel-jbang-mcp (503) pass, `CatalogDocExamplesTest` included. The tests of camel-ldif pass (5, and the 6 of `LdifRouteIT`), and `ConsulActionEnumsTest`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
