Skip to content
Advertisement

Tag: hook

ByteBuddy AgentBuilder Problems setting a Hook to KafkaListenerContainerFactory

I am trying to set a method Hook to KafkaListenerContainerFactory.KafkaListenerContainerFactory() I am having problems defining the method signature and always get the error: java.lang.IllegalArgumentException: None of [private static net.bytebuddy.dynamic.DynamicType$Builder com.bionicstork.analysis.hooks.KafkaListenerAnnotationBeanPostProcessorHook.lambda$install$0(net.bytebuddy.dynamic.DynamicType$Builder,net.bytebuddy.description.type.TypeDescription,java.lang.ClassLoader,net.bytebuddy.utility.JavaModule), public static java.lang.Object com.bionicstork.analysis.hooks.KafkaListenerAnnotationBeanPostProcessorHook.createListenerContainer(java.lang.Object,java.util.concurrent.Callable) throws java.lang.Exception, INSTANCE] allows for delegation from public abstract org.springframework.kafka.listener.MessageListenerContainer org.springframework.kafka.config.KafkaListenerContainerFactory.createListenerContainer(org.springframework.kafka.config.KafkaListenerEndpoint) My code is: Answer The method in question returns a MessageListenerContainer, not a smart life

Is it possible to hook thread creation?

I am making a plugin system and i need to see when a plugin calls Thread.start() Is there a way similar to Runtime.getRuntime().addShutdownHook but for hooking when a thread starts? Answer Byteman You can use Byteman to inject your own code into the thread.start() method. In fact, the first example to using Byteman with JVM classes on their website is

Advertisement