JFrog reference artifacts
Backbase publishes every Grand Central artifact to the internal JFrog repository, including the BOM, SDK, kamelets, API specs, and Maven plugins. Use the repository as your single source of truth for available versions when you don’t have GitHub access to the source repositories. Browse the tree: Grand Central artifacts on JFrog.Important rules and anti-patterns
The following table lists the conventions every connector must follow, along with the rationale for each rule. Apply them when you author or review connector code.SDK utilities and processors with examples
The following examples cover commonly used utilities and processors fromgrandcentral-connectors-sdk. Use them as a starting point; for the full method surface, browse the SDK source.
Load test resources
JunitUtil.loadJsonFromResource(String resourcePath)
A static helper that loads a JSON file from src/test/resources/ and returns it as a Jackson JsonNode. Throws GrandCentralException if the resource is missing or cannot be parsed as JSON.
JunitUtil.loadXmlFromResource(String resourcePath)
Works like the JSON variant, but returns the file as a UTF-8 String. Use it for SOAP request and response fixtures.
JunitUtil.mockRoutes(ModelCamelContext context, List<String> uris, String patternToSkip)
Walks all routes in the context, applies AdviceWith to each route whose input URI contains one of the supplied substrings, and mocks-and-skips endpoints matching patternToSkip. Use it in a @BeforeEach to isolate a route under test.
GrandCentralTestSupportUtil
An abstract base class. Extend it to inherit isUseAdviceWith() and a @BeforeEach that mocks-and-skips all kamelet:* endpoints, plus sensible JVM defaults for XSLT.
JSON manipulation (GrandCentralUtil)
Most GrandCentralUtil methods are instance methods. Bind a single instance to the Camel registry once, then call it using bean("grandCentralUtil", "methodName") in routes or inject it into a Processor. A small number of methods (marked (static) below) are static and can be called directly from a Processor.
convertStringToJsonNode(String string)
Parses a JSON string into a Jackson JsonNode. Wraps ObjectMapper.readTree and is a common entry point when the route body is a String.
appendAttribute(JsonNode json, String key, String value)
Adds a single key:value to a JSON object (or to every element if json is an array). Returns the mutated node.
appendMultipleAttributes(JsonNode jsonNode, Map<String, String> valuesToAppend)
Like appendAttribute, but takes a map for several key/value pairs at once.
appendJsonNode(JsonNode json, String key, JsonNode value)
Sets a nested JSON node under key. Use when the value is itself an object, not a scalar.
convertHeadersToJsonBody(Exchange exchange, String headersStr)
Reads the listed message headers (colon-separated, for example "X-User:X-Channel"), assembles them into a JSON object, and sets it as the new exchange body.
correctNumericAndBooleanValuesInJsonFromProperties(Exchange exchange) (static)
After Jackson converts XML to JSON, every value becomes a quoted string. This method rewrites quoted numerics and booleans into their native JSON types. It reads the skip list from the typeConversion.skipAttributes property in microprofile-config.properties. Call this method immediately after every XML-to-JSON conversion.
typeConversion.skipAttributes in microprofile-config.properties to control which fields stay quoted:
correctNumericAndBooleanValuesInJson(Exchange exchange, Set<String> skipAttributes) (static)
replaceValuesForJson(Exchange exchange)
Reads fieldsToBeReplaced from properties, then replaces each matching JSON path in the body with the corresponding property placeholder value. Handles both single-object and array bodies.
Error handling
transformCoreErrorToGCError(Exchange exchange)
Reads an array of core (vendor) errors from the body. It maps each one through your connector’s error-code property mapping, applies skipErrorCodes, then writes the canonical Grand Central error array back to the body. Use it on the failure branch of vendor calls.
GrandCentralServiceExceptionProcessor(String errorCode, int statusCode)
Throws a GrandCentralServiceException with the supplied error code and HTTP status. Use it as a one-line “throw a typed error” processor inside a route.
Reusable processors
ResponseHeadersFilterProcessor
Removes response headers based on the headerFilterMode exchange property:
REMOVE_PROHIBITED→ strips headers listed in theprohibitedHeadersproperty.KEEP_WHITELISTED→ keeps only headers listed in theacceptedHeadersproperty; removes everything else.
PredicatesValidatingProcessor(Map<Predicate, ErrorMessage> predicates)
Evaluates a map of Camel Predicates against the exchange. Every failing predicate contributes an ErrorMessage to an aggregated GC025 GrandCentralServiceException (HTTP 400). The two-argument constructor adds the header name and value to each error string.
Miscellaneous utilities
getGeneratedUUID(Exchange exchange)
Generates a UUID and stores it on the exchange as the generatedUuid property. Use it for correlation IDs when the upstream system doesn’t provide one.