vert-x3 / vertx-service-proxy

EventBus Proxy generation
Apache License 2.0
66 stars 58 forks source link

Ensure stable 'action' header in delivery options #133

Closed plause closed 2 years ago

plause commented 2 years ago

headers in DeliveryOptions is not deep copied (vertx 4.2.6 currently).

If initial DeliveryOptions provided, calls in those service proxies share the same header instance, making the action header grows at every invocation:

https://github.com/vert-x3/vertx-service-proxy/blob/0bef443030919547e9f96bbc0b8d52e0d73a8683/src/main/java/io/vertx/serviceproxy/generator/ServiceProxyGen.java#L137-L138

Besides, the generated remote handler uses only the first value of the action header:

https://github.com/vert-x3/vertx-service-proxy/blob/0bef443030919547e9f96bbc0b8d52e0d73a8683/src/main/java/io/vertx/serviceproxy/generator/ServiceProxyHandlerGen.java#L133-L136

As a result, all calls are routed to the first method and fail if arguments mismatch.

vietj commented 2 years ago

can you add a test ?

plause commented 2 years ago

See the reopened issue #132 or go direct to the test: https://github.com/plause/vertx-service-proxy-unstable-action-header/blob/dc38ffb80adb91331cd98e5001c1062b75b3096d/src/test/kotlin/com/example/starter/TestMainService.kt

plause commented 2 years ago

I meant you were requesting a reproducer. I am going to look into the tests and will add one.

vietj commented 2 years ago

thanks @plause are we good for review now ?

plause commented 2 years ago

@vietj yes, please review my changes.

vietj commented 2 years ago

thanks this will be available in 4.3.1