hono icon indicating copy to clipboard operation
hono copied to clipboard

HonoReceiverSampler and HonoSenderSampler use Properties in threadStarted() although properties are not yet merged when threadStarted() gets called

Open DanielMaier-BSI opened this issue 7 years ago • 5 comments

HonoReceiverSampler and HonoSenderSampler use Properties in threadStarted() although properties are not yet merged when threadStarted() gets called.

See Warning in JavaDocs of ThreadListener#threadStarted():

WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet.

If you for example use a property for tenant configuration this property will not be replaced in org.eclipse.hono.jmeter.client.HonoReceiver#createConsumer.

See for example TCPSampler how this gets solved there.

DanielMaier-BSI avatar Mar 06 '18 08:03 DanielMaier-BSI

Are you actually experiencing any issues or are you just pointing out a design problem?

sophokles73 avatar Mar 06 '18 13:03 sophokles73

I can workaround this issue by not using properties, but actually I consider this as a bug.

DanielMaier-BSI avatar Mar 07 '18 09:03 DanielMaier-BSI

Does this problem still exist on master? I have made several changes to the samplers recently ...

sophokles73 avatar Mar 07 '18 12:03 sophokles73

Extracting getTenant from vertx thread seems to fix my actual problem https://github.com/eclipse/hono/blob/39f2227be0ac79673d209211deca1633a38f6dcd/jmeter/src/main/java/org/eclipse/hono/jmeter/client/HonoReceiver.java#L86-L100

I still have non-replaced properties in the logs (these properties get retrieved from within vertx thread):

o.e.h.j.c.HonoReceiver: connected to AMQP Messaging Network [${consumer.targetUrl}:${consumer.targetPort}]

To be honest I am not sure if we have just better timing now or if this fixes the problem sustainable. JMeter seems to replace properties again after they were set in the beginning. I don't know if it would be safe to just get all properties in Constructor for example.

DanielMaier-BSI avatar Mar 07 '18 14:03 DanielMaier-BSI

The replacement of the tenant property now works fine for me (0.7-M2).

However there is still the glitches reported by @DanielMaier-BSI in the logging.

I think we can consider this fixed for now.

pho-enix avatar Aug 13 '18 15:08 pho-enix