Skip to content

Commit

Permalink
CAMEL-18494: camel-mllp - Allow the ability to set MIN_BUFFER_SIZE fo…
Browse files Browse the repository at this point in the history
…r SocketBuffer
  • Loading branch information
davsclaus committed Sep 15, 2022
1 parent 09db8cb commit 00b7941
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"defaultCharset": { "kind": "property", "displayName": "Default Charset", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "ISO-8859-1", "description": "Set the default character set to use for byte to\/from String conversions." },
"logPhi": { "kind": "property", "displayName": "Log Phi", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "description": "Whether to log PHI" },
"logPhiMaxBytes": { "kind": "property", "displayName": "Log Phi Max Bytes", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "5120", "description": "Set the maximum number of bytes of PHI that will be logged in a log entry." },
"maxBufferSize": { "kind": "property", "displayName": "Max Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1073741824, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Maximum buffer size used when receiving or sending data over the wire." },
"minBufferSize": { "kind": "property", "displayName": "Min Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 2048, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Minimum buffer size used when receiving or sending data over the wire." },
"readTimeout": { "kind": "property", "displayName": "Read Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5000, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "The SO_TIMEOUT value (in milliseconds) used after the start of an MLLP frame has been received" },
"receiveBufferSize": { "kind": "property", "displayName": "Receive Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "8192", "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Sets the SO_RCVBUF option to the specified value (in bytes)" },
"receiveTimeout": { "kind": "property", "displayName": "Receive Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 15000, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "The SO_TIMEOUT value (in milliseconds) used when waiting for the start of an MLLP frame" },
Expand Down Expand Up @@ -97,6 +99,8 @@
"keepAlive": { "kind": "parameter", "displayName": "Keep Alive", "group": "producer", "label": "advanced,producer", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Enable\/disable the SO_KEEPALIVE socket option." },
"tcpNoDelay": { "kind": "parameter", "displayName": "Tcp No Delay", "group": "producer", "label": "advanced,producer", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Enable\/disable the TCP_NODELAY socket option." },
"lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." },
"maxBufferSize": { "kind": "parameter", "displayName": "Max Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1073741824, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Maximum buffer size used when receiving or sending data over the wire." },
"minBufferSize": { "kind": "parameter", "displayName": "Min Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 2048, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Minimum buffer size used when receiving or sending data over the wire." },
"readTimeout": { "kind": "parameter", "displayName": "Read Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5000, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "The SO_TIMEOUT value (in milliseconds) used after the start of an MLLP frame has been received" },
"receiveBufferSize": { "kind": "parameter", "displayName": "Receive Buffer Size", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "8192", "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "Sets the SO_RCVBUF option to the specified value (in bytes)" },
"receiveTimeout": { "kind": "parameter", "displayName": "Receive Timeout", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 15000, "configurationClass": "org.apache.camel.component.mllp.MllpConfiguration", "configurationField": "configuration", "description": "The SO_TIMEOUT value (in milliseconds) used when waiting for the start of an MLLP frame" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "logPhi": target.setLogPhi(property(camelContext, java.lang.Boolean.class, value)); return true;
case "logphimaxbytes":
case "logPhiMaxBytes": target.setLogPhiMaxBytes(property(camelContext, java.lang.Integer.class, value)); return true;
case "maxbuffersize":
case "maxBufferSize": getOrCreateConfiguration(target).setMaxBufferSize(property(camelContext, int.class, value)); return true;
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": getOrCreateConfiguration(target).setMaxConcurrentConsumers(property(camelContext, int.class, value)); return true;
case "minbuffersize":
case "minBufferSize": getOrCreateConfiguration(target).setMinBufferSize(property(camelContext, int.class, value)); return true;
case "readtimeout":
case "readTimeout": getOrCreateConfiguration(target).setReadTimeout(property(camelContext, int.class, value)); return true;
case "receivebuffersize":
Expand Down Expand Up @@ -131,8 +135,12 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
case "logPhi": return java.lang.Boolean.class;
case "logphimaxbytes":
case "logPhiMaxBytes": return java.lang.Integer.class;
case "maxbuffersize":
case "maxBufferSize": return int.class;
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": return int.class;
case "minbuffersize":
case "minBufferSize": return int.class;
case "readtimeout":
case "readTimeout": return int.class;
case "receivebuffersize":
Expand Down Expand Up @@ -197,8 +205,12 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "logPhi": return target.getLogPhi();
case "logphimaxbytes":
case "logPhiMaxBytes": return target.getLogPhiMaxBytes();
case "maxbuffersize":
case "maxBufferSize": return getOrCreateConfiguration(target).getMaxBufferSize();
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": return getOrCreateConfiguration(target).getMaxConcurrentConsumers();
case "minbuffersize":
case "minBufferSize": return getOrCreateConfiguration(target).getMinBufferSize();
case "readtimeout":
case "readTimeout": return getOrCreateConfiguration(target).getReadTimeout();
case "receivebuffersize":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "lenientbind":
case "lenientBind": target.getConfiguration().setLenientBind(property(camelContext, boolean.class, value)); return true;
case "maxbuffersize":
case "maxBufferSize": target.getConfiguration().setMaxBufferSize(property(camelContext, int.class, value)); return true;
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": target.getConfiguration().setMaxConcurrentConsumers(property(camelContext, int.class, value)); return true;
case "minbuffersize":
case "minBufferSize": target.getConfiguration().setMinBufferSize(property(camelContext, int.class, value)); return true;
case "readtimeout":
case "readTimeout": target.getConfiguration().setReadTimeout(property(camelContext, int.class, value)); return true;
case "receivebuffersize":
Expand Down Expand Up @@ -110,8 +114,12 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
case "lazyStartProducer": return boolean.class;
case "lenientbind":
case "lenientBind": return boolean.class;
case "maxbuffersize":
case "maxBufferSize": return int.class;
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": return int.class;
case "minbuffersize":
case "minBufferSize": return int.class;
case "readtimeout":
case "readTimeout": return int.class;
case "receivebuffersize":
Expand Down Expand Up @@ -169,8 +177,12 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
case "lazyStartProducer": return target.isLazyStartProducer();
case "lenientbind":
case "lenientBind": return target.getConfiguration().isLenientBind();
case "maxbuffersize":
case "maxBufferSize": return target.getConfiguration().getMaxBufferSize();
case "maxconcurrentconsumers":
case "maxConcurrentConsumers": return target.getConfiguration().getMaxConcurrentConsumers();
case "minbuffersize":
case "minBufferSize": return target.getConfiguration().getMinBufferSize();
case "readtimeout":
case "readTimeout": return target.getConfiguration().getReadTimeout();
case "receivebuffersize":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class MllpEndpointUriFactory extends org.apache.camel.support.component.E
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Set<String> MULTI_VALUE_PREFIXES;
static {
Set<String> props = new HashSet<>(28);
Set<String> props = new HashSet<>(30);
props.add("acceptTimeout");
props.add("autoAck");
props.add("backlog");
Expand All @@ -39,7 +39,9 @@ public class MllpEndpointUriFactory extends org.apache.camel.support.component.E
props.add("keepAlive");
props.add("lazyStartProducer");
props.add("lenientBind");
props.add("maxBufferSize");
props.add("maxConcurrentConsumers");
props.add("minBufferSize");
props.add("port");
props.add("readTimeout");
props.add("receiveBufferSize");
Expand Down

0 comments on commit 00b7941

Please sign in to comment.