- Red Hat JBoss Data Grid
- While trying to connect to JDG 7.2 via Spring Boot application version 2.x, the error
org.infinispan.server.hotrod.InvalidMagicIdException: Error reading magic byte or messageis appearing in the logs
- Can't connect to a JDG server 7.2.x using a Spring Boot application
Given a Hot Rod misconfiguration: The Hot Rod version can be changed. Meaning a workaround is to use Hot Rod protocol version 2.5 by setting the parameter
infinispan.client.hotrod.protocol_version = 2.5 in the Spring Boot application properties file.
Given a scenario of something accessing the Hot Rod port: this needs to be investigated.
Hot Rod client would always be the same ID, given a wrong/misconfigured connection the same id will be printed on the JDG server logs.
Two possible root causes: the Hot Rod is misconfigured or there is something trying to access the Hot Rod port.
Hot Rod misconfiguration
Red Hat JBoss Data Grid 7.2.x is based on Infinispan 9.4.x and not certified on Spring Boot 2.x libraries.
Spring Boot 1.5.17 and 2.x have been tested for integration with RHDG 7.3. See Red Hat Data Grid 7 Supported Configurations.
Access to HotRod port
Hot Rod client would always be the same ID. (even if it's the wrong one because it's a different version not configured correctly)
Therefore, when searching on
InvalidMagicIdException see the IDs, in case it changes (example several ids different) so investigate if there isn't something else accessing the Hot Rod port.
- See DG logs
org.infinispan.server.hotrod.InvalidMagicIdException: Error reading magic byte or messagemessage.
- If the
InvalidMagicIdExceptionhas the same ids and periodic, so it is the hot rod client accessing
- Otherwise, in case
InvalidMagicIdExceptionchanges the ids so it is not the same Hot Rod client given that each client will have its own unique id.
- In case there are several ids in a very short timeframe, look for which application is trying to access the Hot Rod.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.