New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Scheduled doesn't work out of the box #125
Comments
That sounds like the correct setup to me. Can you compare your setup to this test? Maybe there is an obvious difference somewhere? Do you register a custom |
It works on an empty project indeed. I think the scheduler configuration doesn't work properly in this case. Not sure why, but I think the conditional
ANd no more relevant mentions of How is this supposed to work, if a bean with this name and type is already present? |
Turned out the problem was that my project already had a @Configuration
public class TaskSchedulerConfig {
@Bean
public ThreadPoolTaskScheduler taskScheduler() {
return new ThreadPoolTaskScheduler();
}
} Maybe it would a great idea to somehow make this configuration not conditional, but make it extend whatever schedulers there are already in the context? And if someone stumbles upon that thread some day: check if you already have a taskScheduler bean defined, guys! It ain't gonna work!! |
Just got the same error. Had to copy paste bean definition from |
@whiskeysierra it doesn't make sense to have both |
2.x is drastically different and has no support for async/scheduled anymore. That responsibility can be delegates https://github.com/opentracing-contrib/java-spring-cloud/blob/master/instrument-starters/opentracing-spring-cloud-core/src/main/java/io/opentracing/contrib/spring/cloud/scheduled/ScheduledAutoConfiguration.java |
I have a spring-boot project with tracer added (more details below). Configuration is just the default one, just the trace name is configured. I'm trying to get my trace value in a
@Scheduled
method, but I getIllegalStateException: X-Flow-ID has not been started
.Question: how is it supposed to work? I think the documentation on this is missing.
Description
spring-boot:1.4.6
.tracer-spring-boot-starter:0.16.0
in dependencies.tracer.traces.X-Flow-ID=flow-id
@Scheduled
method inside of which I'm callingtracer.get("X-Flow-ID").getValue()
on an@Autowired Tracer tracer
field.Question
I didn't really find any docs of what a "support for scheduling" means. I'm sure I'm doing something wrong, but can you point out what's missing? I was expecting that the trace will be already initialized and I can just get it's value (and send in an outgoing request).
The text was updated successfully, but these errors were encountered: