Conversation
mattrpav
commented
Sep 22, 2026
Contributor
- CreateConnection needs to throw immediately, and not on .start()
- ClientID cannot be set on Connection directly
- Throw JMSRuntimeException for invalid JMSContext session modes
- Map and Bytes message spec alignment
- Update the TCK job to use strict spec compliance and validate these fixes address specification scenarios.
…under strict compliance Jakarta Messaging expects createConnection(user, password) to throw JMSSecurityException and createContext to throw JMSSecurityRuntimeException for bad credentials. ActiveMQ defers the ConnectionInfo exchange until first use, so the failure surfaced only on start(). Under strictCompliance the factory now validates the credentials at creation (TCK createConnectionExceptionTests, createJMSContextExceptionTests); the default keeps the lazy behavior. The check uses a throwaway ConnectionInfo that is removed again immediately rather than the connection's own, which would fix the client identifier and make the spec-mandated createConnection() then setClientID() sequence fail with "used connection".
…ID under strict compliance A client identifier set on the connection factory is administratively configured and the specification forbids the application from changing it (IllegalStateException / IllegalStateRuntimeException). ActiveMQ always allowed the override, so enforce only under strictCompliance (TCK setClientIDOnAdminConfiguredIDTest).
Jakarta Messaging requires createContext to throw JMSRuntimeException for an invalid session mode. Validate on every createContext entry point (factory and child contexts) while keeping ActiveMQ's INDIVIDUAL_ACKNOWLEDGE extension valid (TCK createJMSContextExceptionTests).
… write-only BytesMessage getBody MapMessage.setObject routed values through the message-property validator, which rejects Character under strictCompliance; char is a valid MapMessage body type (setChar), so Character now bypasses that check like byte[] does (TCK foreignMsg sendReceiveMapMsg tests). BytesMessage.isBodyAssignableTo treated null content as no body, but bytes written in write-only mode sit in bytesOut until stored, so getBody accepted any type. Account for pending written bytes when deciding whether a body exists (TCK getBodyExceptionTests).
…ing broker The exception-type fixes are gated on strictCompliance, so the TCK connection factories enable it. The TCK expects invalid credentials to be rejected (JMSSecurityException from createConnection, JMSSecurityRuntimeException from createContext). The embedded broker authenticates the ts.jte user with SimpleAuthenticationPlugin and keeps anonymous access for the many tests that connect without credentials; activemq-jaas supplies the principals the plugin needs inside the shaded runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.