-
Notifications
You must be signed in to change notification settings - Fork 306
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
Updated conditional on job bean to support kabob case. #795
Conversation
@@ -78,7 +78,7 @@ private void validateProperties(SingleStepJobProperties properties) { | |||
|
|||
@Bean | |||
@ConditionalOnMissingBean | |||
@ConditionalOnProperty(prefix = "spring.batch.job", name = "jobName") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be sufficient to change this line to
@ConditionalOnProperty(prefix = "spring.batch.job", name = "job-name")
If name
is given in kebab case, then it will also match camel case. But not the other way around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hpoettker great catch! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change "if" to "whether" in all these cases because it is best to use "if" only to introduce conditional material and use "whether" to present two choices. It's both a matter of convention and a matter of clarity. Merriam Webster gives a good take on it: https://www.merriam-webster.com/words-at-play/if-vs-whether-difference-usage
...rc/main/java/org/springframework/cloud/task/batch/autoconfigure/SingleStepJobProperties.java
Outdated
Show resolved
Hide resolved
...rg/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemReaderProperties.java
Outdated
Show resolved
Hide resolved
...rg/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemReaderProperties.java
Outdated
Show resolved
Hide resolved
...rg/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemReaderProperties.java
Outdated
Show resolved
Hide resolved
...rg/springframework/cloud/task/batch/autoconfigure/flatfile/FlatFileItemReaderProperties.java
Outdated
Show resolved
Hide resolved
private boolean enabled; | ||
|
||
/** | ||
* Establishes whether the {@link Jackson2JsonMessageConverter} is to be used as a | ||
* message converter. Defaults to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the double space to a single space and make "true" be code: {@code true}
@@ -26,8 +26,15 @@ | |||
@ConfigurationProperties(prefix = "spring.batch.job.amqpitemwriter") | |||
public class AmqpItemWriterProperties { | |||
|
|||
/** | |||
* Enables or disables the AmqpItemWriter. Defaults to false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the double space to a single space and make "false" be code: {@code false}
private boolean enabled; | ||
|
||
/** | ||
* Establishes whether the {@link Jackson2JsonMessageConverter} is to be used as a | ||
* message converter. Defaults to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the double space be a single space and make "true" be code: {@code true}
@@ -39,7 +46,7 @@ public boolean isEnabled() { | |||
} | |||
|
|||
/** | |||
* Enables or disables the AmqpItemReader. | |||
* Enables or disables the AmqpItemWriter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make "AmqpItemWriter" be code: {@code AmqpItemWriter}
@@ -39,7 +46,7 @@ public boolean isEnabled() { | |||
} | |||
|
|||
/** | |||
* Enables or disables the AmqpItemReader. | |||
* Enables or disables the AmqpItemWriter. | |||
* @param enabled if true then AmqpItemWriter will be enabled. Defaults to false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also added comments reader and writer properties so that boot's metadata resolver can utilize them. resolves spring-cloud#794
@mminella approved PR. |
Also added comments reader and writer properties so that boot's metadata resolver can utilize them.
resolves #794