Description
Hi, I'am very new at Camel and I've being trying to use the component camel-file-watch (version:3.0.0-RC1).
When I set thing up with spring-boot, it does not seem to dectect file systems events.
With a little investigation, I found that the property conversion of events from the uri scheme (file-watch://some-directory?events=DELETE,CREATE) to the endpoint is calling
(FileWatchEndpoint.java)
public void setEvents(Set<FileEventEnum> events)
Instead of
(FileWatchEndpoint.java)
@SuppressWarnings("unused") //called via reflection
public void setEvents(String commaSeparatedEvents) {
String[] stringArray = commaSeparatedEvents.split(",");
Set<FileEventEnum> eventsSet = new HashSet<>();
for (String event : stringArray)
events = eventsSet.isEmpty() ? new HashSet<>(Arrays.asList(FileEventEnum.values())) : eventsSet;
}
(FileWatchEndpoint.java) events object declaration
@UriParam(label = "consumer",
enums = "CREATE,MODIFY,DELETE",
description = "Comma separated list of events to watch.",
defaultValue = "CREATE,MODIFY,DELETE")
private Set<FileEventEnum> events = new HashSet<>(Arrays.asList(FileEventEnum.values()));
Basically the conversion from String to Set<FileEventEnum> fails and the component is calling the first method listed above with Set<String> instead of Set<FileEventEnum>
I got it to work by adding a converter from String to Set<FileEventEnum> but I feel like this should have been taken care of by the component.
Let me know what you think
Attachments
Issue Links
- links to