Skip to content

Incorrectly getting error "Collapser method must have one argument" from CollapserMetaHolderFactory #1458

Closed
@ppetrosyan

Description

@ppetrosyan

I am having a strange issue. I have a method which is annotated with HystrixCommand

`
@OverRide
@HystrixCommand(fallbackMethod = "getDataFallback",
commandProperties = {
@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "60000"),
@HystrixProperty(name="execution.isolation.thread.interruptOnTimeout", value="TRUE"),
@HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "20"),
@HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000"),
@HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "50")
},
threadPoolProperties = {
@HystrixProperty(name = "coreSize", value = "10")
})

public List getData(String id, Date date) {
return null;
}
`

it works most of the times, but rarely without changing anything I get the following exception

java.lang.IllegalStateException: Collapser method must have one argument: public java.util.List getData(String,Date)

I checked the code of Hystrix and found that the meta holder factory checks if the HystrixCommand annotation is present then it initializes CommandMetaHolderFactory, otherwise CollapserMetaHolderFactory. In my case, I have the HystrixCommand but it still tries to use CollapserMetaHolderFactory which complains about method not having 1 argument.

This happens rarely and it's possible no one has seen it yet, I was just wondering if there is a recent fix related to this issue. I am using hystrix 1.5.0.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions