Skip to content

RSocket MetadataEncoder expands the routes incorrect #24656

@joshiste

Description

@joshiste

When using route("process.{id}.log", "deadbeef") I'd expect the route to be expanded to process.deadbeef.log but to my suprise it's expanded to process.deadbeef.

Affected version: spring-messaging 5.2.4.RELEASE

I could track down the error to the org.springframework.messaging.rsocket.MetadataEncoder.
This minimal sample illustrates the bug (sorry for the reflection hackery):

public static void main(String[] args) throws Exception {
   Class<?> clazz = Class.forName("org.springframework.messaging.rsocket.MetadataEncoder");
    Method expandMethod = clazz.getDeclaredMethod("expand", String.class, Object[].class);
    expandMethod.setAccessible(true);
    String route = (String) expandMethod.invoke(null, "process.{id}.log", new Object[]{"deadbeef"});
    System.out.println(route);
}

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions