openmessaging-java
openmessaging-java copied to clipboard
Use Class.forName(String name, boolean initialize,ClassLoader loader) to get the MessagingAccessPoint.class
Sometimes we use OMS.builder().build(properties) to create the MessagingAccessPoint, it can work well in most scenarios. But sometimes there are existed problem.
If we load the openmessaging-api
in moduleA
, and we use a customized ClassLoader to load the driver class, then we cannot get the driver class by Class.forName(driverImpl)
It is better to use Class.forName(String name, boolean initialize,ClassLoader loader)
to get the driver class in line 50.
https://github.com/openmessaging/openmessaging-java/blob/5d79606316033de21cf784232c27d2fd65d31d44/openmessaging-api/src/main/java/io/openmessaging/internal/MessagingAccessPointAdapter.java#L46-L65