Repository: camel Updated Branches: refs/heads/master c94c61982 -> 05a2830cb
http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/components/camel-yammer/src/main/docs/yammer-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-yammer/src/main/docs/yammer-component.adoc b/components/camel-yammer/src/main/docs/yammer-component.adoc index 4cc543b..e4bb4c3 100644 --- a/components/camel-yammer/src/main/docs/yammer-component.adoc +++ b/components/camel-yammer/src/main/docs/yammer-component.adoc @@ -88,9 +88,9 @@ with the following path and query parameters: | useJson | common | false | boolean | Set to true if you want to use raw JSON rather than converting to POJOs. | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN or ERROR level and ignored. | delay | consumer | 5000 | long | Delay between polling in millis -| limit | consumer | 1 | int | Return only the specified number of messages. Works for threaded=true and threaded=extended. -| newerThan | consumer | 1 | int | Returns messages newer than the message ID specified as a numeric string. This should be used when polling for new messages. If you're looking at messages and the most recent message returned is 3516 you can make a request with the parameter newerThan=3516 to ensure that you do not get duplicate copies of messages already on your page. -| olderThan | consumer | 1 | int | Returns messages older than the message ID specified as a numeric string. This is useful for paginating messages. For example if you're currently viewing 20 messages and the oldest is number 2912 you could append olderThan=2912 to your request to get the 20 messages prior to those you're seeing. +| limit | consumer | -1 | int | Return only the specified number of messages. Works for threaded=true and threaded=extended. +| newerThan | consumer | -1 | int | Returns messages newer than the message ID specified as a numeric string. This should be used when polling for new messages. If you're looking at messages and the most recent message returned is 3516 you can make a request with the parameter newerThan=3516 to ensure that you do not get duplicate copies of messages already on your page. +| olderThan | consumer | -1 | int | Returns messages older than the message ID specified as a numeric string. This is useful for paginating messages. For example if you're currently viewing 20 messages and the oldest is number 2912 you could append olderThan=2912 to your request to get the 20 messages prior to those you're seeing. | sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead. | threaded | consumer | | String | threaded=true will only return the first message in each thread. This parameter is intended for apps which display message threads collapsed. threaded=extended will return the thread starter messages in order of most recently active as well as the two most recent messages as they are viewed in the default view on the Yammer web interface. | userId | consumer | | String | The user id http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java ---------------------------------------------------------------------- diff --git a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java index 4acdb25..c78d79c 100644 --- a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java +++ b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/JSonSchemaHelper.java @@ -35,7 +35,7 @@ public final class JSonSchemaHelper { private static final String VALID_CHARS = ".-='/\\!&():;"; // 0 = text, 1 = enum, 2 = boolean, 3 = integer or number - private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(\\d+\\.?\\d*)"); + private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(-?\\d+\\.?\\d*)"); private static final String QUOT = """; private JSonSchemaHelper() { http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java ---------------------------------------------------------------------- diff --git a/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java b/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java index 318cbf4..774facd 100644 --- a/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java +++ b/platforms/camel-catalog/src/main/java/org/apache/camel/catalog/JSonSchemaHelper.java @@ -28,7 +28,7 @@ import java.util.regex.Pattern; public final class JSonSchemaHelper { // 0 = text, 1 = enum, 2 = boolean, 3 = integer or number - private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(\\d+\\.?\\d*)"); + private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(-?\\d+\\.?\\d*)"); private static final String QUOT = """; private JSonSchemaHelper() { http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java ---------------------------------------------------------------------- diff --git a/platforms/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java index 694ee76..3494c62 100644 --- a/platforms/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java +++ b/platforms/camel-catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java @@ -245,6 +245,16 @@ public class CamelCatalogTest { } @Test + public void testAsEndpointDefaultValue() throws Exception { + Map<String, String> map = new HashMap<String, String>(); + map.put("destinationName", "cheese"); + map.put("maxMessagesPerTask", "-1"); + + String uri = catalog.asEndpointUri("jms", map, true); + assertEquals("jms:cheese?maxMessagesPerTask=-1", uri); + } + + @Test public void testAsEndpointUriPropertiesPlaceholders() throws Exception { Map<String, String> map = new HashMap<String, String>(); map.put("timerName", "foo"); @@ -1036,6 +1046,16 @@ public class CamelCatalogTest { } @Test + public void testValidateEndpointJmsDefault() throws Exception { + String uri = "jms:cheese?maxMessagesPerTask=-1"; + + EndpointValidationResult result = catalog.validateEndpointProperties(uri); + assertTrue(result.isSuccess()); + assertEquals(1, result.getDefaultValues().size()); + assertEquals("-1", result.getDefaultValues().get("maxMessagesPerTask")); + } + + @Test public void testValidateEndpointConsumerOnly() throws Exception { String uri = "file:inbox?bufferSize=4096&readLock=changed&delete=true"; EndpointValidationResult result = catalog.validateEndpointProperties(uri, false, true, false); http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/spring-boot/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConfiguration.java index 2143b20..878b5ef 100644 --- a/platforms/spring-boot/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConfiguration.java @@ -246,7 +246,7 @@ public class AMQPComponentConfiguration { * value to eg 100 to control how fast the consumers will shrink when less * work is required. */ - private Integer maxMessagesPerTask = 1; + private Integer maxMessagesPerTask = -1; /** * To use a custom Spring * org.springframework.jms.support.converter.MessageConverter so you can be @@ -323,7 +323,7 @@ public class AMQPComponentConfiguration { * When sending messages specifies the time-to-live of the message (in * milliseconds). */ - private Long timeToLive = 1L; + private Long timeToLive = -1L; /** * Specifies whether to use transacted mode */ @@ -346,7 +346,7 @@ public class AMQPComponentConfiguration { * The timeout value of the transaction (in seconds) if using transacted * mode. */ - private Integer transactionTimeout = 1; + private Integer transactionTimeout = -1; /** * Specifies whether to test the connection on startup. This ensures that * when Camel starts that all the JMS consumers have a valid connection to http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java index 466fe22..401acb9 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/impl/springboot/ZipDataFormatConfiguration.java @@ -30,7 +30,7 @@ public class ZipDataFormatConfiguration { * To specify a specific compression between 0-9. -1 is default compression * 0 is no compression and 9 is best compression. */ - private Integer compressionLevel = 1; + private Integer compressionLevel = -1; /** * Whether the data format should set the Content-Type header with the type * from the data format if the data format is capable of doing so. For http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/spring-boot/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConfiguration.java index 6e6b92e..53de646 100644 --- a/platforms/spring-boot/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConfiguration.java @@ -16,7 +16,6 @@ */ package org.apache.camel.component.google.calendar.springboot; -import java.util.List; import org.apache.camel.component.google.calendar.GoogleCalendarClientFactory; import org.apache.camel.component.google.calendar.internal.GoogleCalendarApiName; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -113,11 +112,11 @@ public class GoogleCalendarComponentConfiguration { private String applicationName; /** * Specifies the level of permissions you want a calendar application to - * have to a user account. See - * https://developers.google.com/google-apps/calendar/auth for more + * have to a user account. You can separate multiple scopes by comma. + * See https://developers.google.com/google-apps/calendar/auth for more * info. */ - private List scopes; + private String scopes = com.google.api.services.calendar.CalendarScopes.CALENDAR; /** * The name of the p12 file which has the private key to use with the * Google Service Account. @@ -193,11 +192,11 @@ public class GoogleCalendarComponentConfiguration { this.applicationName = applicationName; } - public List getScopes() { + public String getScopes() { return scopes; } - public void setScopes(List scopes) { + public void setScopes(String scopes) { this.scopes = scopes; } http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java index 607335b..1f50c64 100644 --- a/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java @@ -250,7 +250,7 @@ public class JmsComponentConfiguration { * value to eg 100 to control how fast the consumers will shrink when less * work is required. */ - private Integer maxMessagesPerTask = 1; + private Integer maxMessagesPerTask = -1; /** * To use a custom Spring * org.springframework.jms.support.converter.MessageConverter so you can be @@ -325,7 +325,7 @@ public class JmsComponentConfiguration { * When sending messages specifies the time-to-live of the message (in * milliseconds). */ - private Long timeToLive = 1L; + private Long timeToLive = -1L; /** * Specifies whether to use transacted mode */ @@ -348,7 +348,7 @@ public class JmsComponentConfiguration { * The timeout value of the transaction (in seconds) if using transacted * mode. */ - private Integer transactionTimeout = 1; + private Integer transactionTimeout = -1; /** * Specifies whether to test the connection on startup. This ensures that * when Camel starts that all the JMS consumers have a valid connection to http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java ---------------------------------------------------------------------- diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java index caebe71..baba1c0 100644 --- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java +++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/helper/JsonSchemaHelper.java @@ -35,7 +35,7 @@ public final class JsonSchemaHelper { private static final String VALID_CHARS = ".-='/\\!&():;"; // 0 = text, 1 = enum, 2 = boolean, 3 = integer or number - private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(\\d+\\.?\\d*)"); + private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(-?\\d+\\.?\\d*)"); private static final String QUOT = """; private JsonSchemaHelper() { http://git-wip-us.apache.org/repos/asf/camel/blob/05a2830c/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/JSonSchemaHelper.java ---------------------------------------------------------------------- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/JSonSchemaHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/JSonSchemaHelper.java index 1e7ab3b..5461511 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/JSonSchemaHelper.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/JSonSchemaHelper.java @@ -26,7 +26,7 @@ import java.util.regex.Pattern; public final class JSonSchemaHelper { // 0 = text, 1 = enum, 2 = boolean, 3 = integer or number - private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(\\d+\\.?\\d*)"); + private static final Pattern PATTERN = Pattern.compile("\"(.+?)\"|\\[(.+)\\]|(true|false)|(-?\\d+\\.?\\d*)"); private static final String QUOT = """; private JSonSchemaHelper() {