svn commit: r882668 - in /websites/production/camel/content: book-dataformat-appendix.html book-in-one-page.html cache/main.pageCache crypto.html

2013-10-14 Thread buildbot
Author: buildbot
Date: Tue Oct 15 05:25:54 2013
New Revision: 882668

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/book-dataformat-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/crypto.html

Modified: websites/production/camel/content/book-dataformat-appendix.html
==
--- websites/production/camel/content/book-dataformat-appendix.html (original)
+++ websites/production/camel/content/book-dataformat-appendix.html Tue Oct 15 
05:25:54 2013
@@ -3784,7 +3784,7 @@ from("direct:key-in-header-decrypt").unm
 
 PGPDataFormat 
Options
 
- Name  Type  Default  Description  keyUserid  String  null  The userid of the key in the PGP keyring. 
 
password  
String  
null  Password 
used when opening the private key (not used for encryption).  keyFileName  String  null  Filename of the keyring; must be accessible as a 
classpath resource (but you can specify a location in the file system by using 
the "file:" prefix).  encryptionKeyRing  byte[]  null  Since camel 2.12.1 encryption keyring; 
you can not set the keyFileName and encryptionKeyRing at the same time. 
 
signatureKeyUserid  String  null  Since Camel 2.11.0 Optional userid of the key in 
the PGP keyring to use for signing (during encryption) or signature 
verification (during decryption) . signaturePassword  String  null  Since Camel 2.11.0 Optional password 
used when opening the private key used for signing (during encryption). 
 
signatureKeyFileName  String  null  Since Camel 2.11.0 Optional filename of the 
keyring to use fo
 r signing (during encryption) or for signature verification (during 
decryption); must be accessible as a classpath resource (but you can specify a 
location in the file system by using the "file:" prefix).  signatureKeyRing 
 byte[]  null  Since camel 2.12.1 
signature keyring; you can not set the signatureKeyFileName and 
signatureKeyRing at the same time.  armored  boolean  false  This option will cause PGP to base64 encode the encrypted 
text, making it available for copy/paste, etc.
   
integrity  
boolean  
true  Adds an 
integrity check/sign into the encryption file. 
+ Name  Type  Default  Description  keyUserid  String  null  The userid of the key in the PGP keyring. 
 
password  
String  
null  Password 
used when opening the private key (not used for encryption).  keyFileName  String  null  Filename of the keyring; must be accessible as a 
classpath resource (but you can specify a location in the file system by using 
the "file:" prefix).  encryptionKeyRing  byte[]  null  Since camel 2.12.1 encryption keyring; 
you can not set the keyFileName and encryptionKeyRing at the same time. 
 
signatureKeyUserid  String  null  Since Camel 2.11.0 Optional userid of the key in 
the PGP keyring to use for signing (during encryption) or signature 
verification (during decryption) . signaturePassword  String  null  Since Camel 2.11.0 Optional password 
used when opening the private key used for signing (during encryption). 
 
signatureKeyFileName  String  null  Since Camel 2.11.0 Optional filename of the 
keyring to use fo
 r signing (during encryption) or for signature verification (during 
decryption); must be accessible as a classpath resource (but you can specify a 
location in the file system by using the "file:" prefix).  signatureKeyRing 
 byte[]  null  Since camel 2.12.1 
signature keyring; you can not set the signatureKeyFileName and 
signatureKeyRing at the same time.  algorithm  int  SymmetricKeyAlgorithmTags.CAST5  Since camel 2.12.2 
symmetric key encryption algorithm; possible values ar
 e defined in org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags; for 
example 2 (= TRIPLE DES), 3 (= CAST5), 4 (= BLOWFISH), 6 (= DES), 7 (= AES_128) 
 
hashAlgorithm  
int  
HashAlgorithmTags.SHA1  Since camel 2.12.2 signature hash algorithm; 
possible values are defined in 
org.bouncycastle.bcpg.HashAlgorithmTags; for example 2 (= SHA1), 8 (= 
SHA256), 9 (= SHA384), 10 (= SHA512), 11 (=SHA224)  armored  boolean  false  This option will cause PGP to 
base64 encode the encryp
 ted text, making it available for copy/paste, etc.  integrity  boolean  true  Adds an integrity check/sign into 
the encryption file. 
 
 
 
@@ -3793,7 +3793,7 @@ from("direct:key-in-header-decrypt").unm
 
 
 
- Name  Type  Description  CamelPGPDataFormatKeyFileName  String  Since Camel 2.11.0 
Filename of the keyring; will override existing setting directly on the 
PGPDataFormat.  
CamelPGPDataFormatEncryptionKeyRing  byte[]  Since Camel 2.12.1 the encryption keyring; will 
override existing setting directly on the PGPDataFormat.  CamelPGPDataForm
 atKeyUserid  
String  Since 
Camel 2.11.0 The userid of the key in the PGP keyring; will override 
existing setting directly on the PGPDataFormat.  CamelPGPDataFormatKeyPassword 
 Stri

[CONF] Apache Camel > Crypto

2013-10-14 Thread Franz Forsthofer (Confluence)







Crypto
Page edited by Franz Forsthofer


 Changes (2)
 




...
| {{signatureKeyFileName}} | {{String}} | {{null}} | *Since Camel 2.11.0* Optional filename of the keyring to use for signing (during encryption) or for signature verification (during decryption); must be accessible as a classpath resource (but you can specify a location in the file system by using the "file:" prefix). | | {{signatureKeyRing}} | {{byte\[\]}} | {{null}} | *Since camel 2.12.1* signature keyring; you can not set the signatureKeyFileName and signatureKeyRing at the same time. |  
| {{algorithm}} | {{int}} | {{SymmetricKeyAlgorithmTags.CAST5}} | *Since camel 2.12.2* symmetric key encryption algorithm; possible values are defined in {{org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags}}; for example 2 (= TRIPLE DES), 3 (= CAST5), 4 (= BLOWFISH), 6 (= DES), 7 (= AES_128) | | {{hashAlgorithm}} | {{int}} | {{HashAlgorithmTags.SHA1}} | *Since camel 2.12.2* signature hash algorithm; possible values are defined in {{org.bouncycastle.bcpg.HashAlgorithmTags}}; for example 2 (= SHA1), 8 (= SHA256), 9 (= SHA384), 10 (= SHA512), 11 (=SHA224) | 
| {{armored}} | {{boolean}} | {{false}} | This option will cause PGP to base64 encode the encrypted text, making it available for copy/paste, etc. | | {{integrity}} | {{boolean}} | {{true}} | Adds an integrity check/sign into the encryption file. | 
...
| {{CamelPGPDataFormatSignatureKeyUserid}} | {{String}} | *Since Camel 2.11.0* The userid of the signature key in the PGP keyring; will override existing setting directly on the PGPDataFormat. | | {{CamelPGPDataFormatSignatureKeyPassword}} | {{String}} | *Since Camel 2.11.0* Password used when opening the signature private key; will override existing setting directly on the PGPDataFormat. | 
| {{CamelPGPDataFormatEncryptionAlgorithm}} | {{int}} | *Since Camel 2.12.2* symmetric key encryption algorithm; will override existing setting directly on the PGPDataFormat. | | {{CamelPGPDataFormatSignatureHashAlgorithm}} | {{int}} | *Since Camel 2.12.2* signature hash algorithm; will override existing setting directly on the PGPDataFormat. | 
 h3. Encrypting with PGPDataFormat 
...


Full Content

Crypto
Available as of Camel 2.3
PGP Available as of Camel 2.9

The Crypto Data Format integrates the Java Cryptographic Extension into Camel, allowing simple and flexible encryption and decryption of messages using Camel's familiar marshall and unmarshal formatting mechanism. It assumes marshalling to mean encryption to cyphertext and unmarshalling to mean decryption back to the original plaintext. This data format implements only symmetric (shared-key) encryption and decyption.

Options



 Name 
 Type 
 Default 
 Description 


 algorithm 
 String 
 DES/CBC/PKCS5Padding 
 The JCE algorithm name indicating the cryptographic algorithm that will be used. 


 algorithmParameterSpec 
 java.security.spec.AlgorithmParameterSpec 
 null 
A JCE AlgorithmParameterSpec used to initialize the Cipher. 


 bufferSize 
 Integer 
 2048 
 the size of the buffer used in the signature process. 


 cryptoProvider 
 String 
 null 
 The name of the JCE Security Provider that should be used. 


 initializationVector 
 byte[] 
 null 
 A byte array containing the Initialization Vector that will be used to initialize the Cipher. 


 inline 
 boolean 
 false 
 Flag indicating that the configured IV should be inlined into the encrypted data stream. 


 macAlgorithm 
 String 
 null 
 The JCE algorithm name indicating the Message Authentication algorithm. 


 shouldAppendHMAC 
 boolean 
 null 
 Flag indicating that a Message Authentication Code should be calculated and appended to the encrypted data.





Basic Usage
At its most basic all that is required to encrypt/decrypt an exchange is a shared secret key. If one or more instances of the Crypto data format are configured with this key the format can be used to encrypt the payload in one route (or part of one) and decrypted in another. For example, using the Java DSL as follows:





In Spring the dataformat is configured first and then used in routes 




  

  
...
  





  




Specifying the Encryption Algorithm

Changing the algorithm is a matter of supplying the JCE algorithm name. If you change the algorithm you will need to use a compatible key.





A list of the available algorithms in Java 7 is available via the Java Cryptography Architecture Standard Algorithm Name Documentation.

Specifying an Initialization Vector

Some crypto algorithms, particularly block algorithms, require configuration with an initial block of data known as an Initialization Vector. In the JCE this is passed as an AlgorithmParameterSp

[3/3] git commit: Removed unused import

2013-10-14 Thread davsclaus
Removed unused import


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/48bc2cb1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/48bc2cb1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/48bc2cb1

Branch: refs/heads/camel-2.11.x
Commit: 48bc2cb1ef8e1d8aa38c2fb70c8811dcdf4f14de
Parents: fed68b4
Author: Claus Ibsen 
Authored: Mon Oct 14 18:15:35 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 18:17:39 2013 +0200

--
 .../java/org/apache/camel/component/log/LogCustomFormatterTest.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/48bc2cb1/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
index 59047ef..b21cfe2 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.log;
 
-import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.ResolveEndpointFailedException;



[1/3] git commit: Removed unused import

2013-10-14 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x fed68b407 -> 48bc2cb1e
  refs/heads/camel-2.12.x e7bf1703d -> d809c0c5b
  refs/heads/master 3a5ffd5a7 -> 32c22d529


Removed unused import


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/32c22d52
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/32c22d52
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/32c22d52

Branch: refs/heads/master
Commit: 32c22d52969fb9c2ab47116311c2d50e9be4a60d
Parents: 3a5ffd5
Author: Claus Ibsen 
Authored: Mon Oct 14 18:15:35 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 18:15:35 2013 +0200

--
 .../java/org/apache/camel/component/log/LogCustomFormatterTest.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/32c22d52/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
index 59047ef..b21cfe2 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.log;
 
-import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.ResolveEndpointFailedException;



[2/3] git commit: Removed unused import

2013-10-14 Thread davsclaus
Removed unused import


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d809c0c5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d809c0c5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d809c0c5

Branch: refs/heads/camel-2.12.x
Commit: d809c0c5bb0f812748fedcadc86656cd97bfb296
Parents: e7bf170
Author: Claus Ibsen 
Authored: Mon Oct 14 18:15:35 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 18:17:17 2013 +0200

--
 .../java/org/apache/camel/component/log/LogCustomFormatterTest.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/d809c0c5/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
index 59047ef..b21cfe2 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/log/LogCustomFormatterTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.log;
 
-import org.apache.camel.CamelExecutionException;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.ResolveEndpointFailedException;



svn commit: r882563 - in /websites/production/camel/content: aws-sqs.html book-component-appendix.html book-in-one-page.html cache/main.pageCache

2013-10-14 Thread buildbot
Author: buildbot
Date: Mon Oct 14 16:20:01 2013
New Revision: 882563

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/aws-sqs.html
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/aws-sqs.html
==
--- websites/production/camel/content/aws-sqs.html (original)
+++ websites/production/camel/content/aws-sqs.html Mon Oct 14 16:20:01 2013
@@ -103,7 +103,7 @@ You can append query options to the URI 
 
 URI Options
 
- Name  Default Value  Context  Description amazonSQSClient  null  Shared  Reference to a 
com.amazonaws.services.sqs.AmazonSQS in the Registry. accessKey  null  Shared  Amazon AWS Access Key secretKey  null  Shared  Amazon AWS Secret Key amazonSQSEndpoint  null  Shared  The region with which the AWS-SQS client wants to work 
with. Only works if Camel creates the AWS-SQS client, i.e., if you explicitly 
set amazonSQSClient, then this setting will have no effect. You would have to 
set it on the client you create directly attributeNames  null  Consumer 
  A list of attributes to set 
in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. 
defaultVisibilityTimeout  null  Shared  The visibility timeout (in seconds) to set in the 
com.amazonaws.services.sqs.model.CreateQueueRequest. deleteAfterRead  true  Consumer  Delete message from SQS after it has been 
read deleteIfFiltered  true  Consumer  colspan="1" rowspan="1" class="confluenceTd"> Whether or not to send the 
 > DeleteMessage to the SQS queue if an exchange fails to get through a filter. 
 > If 'false' and exchange does not make it through a Camel filter upstream in 
 > the route, then don't send DeleteMessage.  rowspan="1" class="confluenceTd">maxMessagesPerPoll rowspan="1" class="confluenceTd"> null  rowspan="1" class="confluenceTd"> Consumer  class="confluenceTd"> The maximum number of messages which can be received 
 > in one poll to set in the 
 > com.amazonaws.services.sqs.model.ReceiveMessageRequest. 
 >  class="confluenceTd">visibilityTimeout  class="confluenceTd"> null  class="confluenceTd"> Shared  The duration (in seconds) that the received messages 
are hidden from subsequent retrieve requests after being retrieved by a 
ReceiveMessage request to set in the 
com.amazonaws.services.sqs.model.SetQueueAttributesRequest. This only 
make sense if its different from defaultVisibilityTimeout. It changes 
the queue visibility timeout attribute permanently. messageVisibilityTimeout  null  Consumer  Camel 2.8: The duration (in seconds) 
that the received messages are hidden from subsequent retrieve requests after 
being retrieved by a ReceiveMessage request to set in the 
com.amazonaws.services.sqs.model.ReceiveMessageRequest. It does 
NOT change the queue visibility timeout attribute permanently. 
  
extendMessageVisibility  
false  Consumer 
 Camel 2.10: If 
enabled then a scheduled background task will keep extending the message 
visibility on SQS. This is needed if it taks a long time to process the 
message. If set to true defaultVisibilityTimeout must be set.  See 
details at http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Query_QueryChangeMessageVisibility.html";
 rel="nofollow">Amazon docs. maximumMessageSize  null  Shared  Ca
 mel 2.8: The maximumMessageSize (in bytes) an SQS message can contain for 
this queue, to set in the 
com.amazonaws.services.sqs.model.SetQueueAttributesRequest. 
messageRetentionPeriod  null  Shared  Camel 2.8: The messageRetentionPeriod (in seconds) 
a message will be retained by SQS for this queue, to set in the 
com.amazonaws.services.sqs.model.SetQueueAttributesRequest. 
policy  null  Shared  Camel 2.8: The policy for this queue 
to set in the com.amazonaws.services.sqs.model.SetQueueAt
 tributesRequest. delaySeconds  null  Producer  Camel 2.9.3: Delay sending messages for a number 
of seconds. waitTimeSeconds  0  Producer  Camel 2.11: Duration in seconds (0 to 20) that the 
ReceiveMessage action call will wait until a message is in the queue to include 
in the response. receiveMessageWaitTimeSeconds  0  Shared  Camel 2.11: If you 
do not specify WaitTimeSeconds in the request, the queue attribute 
ReceiveMessageWaitTimeSeconds is used to determine how long to wait. 
queueOwnerAWSAccountId  null  Camel 2.12: Specify the queue owner aws account id 
when you need to connect the queue with different account owner. 

+ Name  Default Value  Context  Description amazonSQSClient  null  Shared  Reference to a 
com.amazonaws.services.sqs.AmazonSQS in the Registry. accessKey  null  Shared  Amazon AWS Access Key secretKey  null  Shared  Amazon AWS Secret Key amazonSQSEndpoint  null  Shared  The region with which the AWS-SQS client wants to work 
with. Only works if Camel creates the AWS

[CONF] Apache Camel > AWS-SQS

2013-10-14 Thread Christian Posta (Confluence)







AWS-SQS
Page edited by Christian Posta


 Changes (2)
 




...
|defaultVisibilityTimeout | {{null}} | Shared | The visibility timeout (in seconds) to set in the {{com.amazonaws.services.sqs.model.CreateQueueRequest}}. | |deleteAfterRead | {{true}} | Consumer | Delete message from SQS after it has been read | 
|deleteIfFiltered | {{true}} | Consumer | *Camel 2.12.2,2.13* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | 
|maxMessagesPerPoll| {{null}} | Consumer | The maximum number of messages which can be received in one poll to set in the {{com.amazonaws.services.sqs.model.ReceiveMessageRequest}}. | |visibilityTimeout | {{null}} | Shared | The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the {{com.amazonaws.services.sqs.model.SetQueueAttributesRequest}}. This only make sense if its different from {{defaultVisibilityTimeout}}. It changes the queue visibility timeout attribute permanently. | 
...
|waitTimeSeconds | {{0}} | Producer | *Camel 2.11:* Duration in seconds (0 to 20) that the ReceiveMessage action call will wait until a message is in the queue to include in the response. | |receiveMessageWaitTimeSeconds | {{0}} | Shared | *Camel 2.11:* If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine how long to wait. | 
|queueOwnerAWSAccountId | {{null}} | Shared |*Camel 2.12:* Specify the queue owner aws account id when you need to connect the queue with different account owner. | 
{div}  
...


Full Content

SQS Component
Available as of Camel 2.6

The sqs component supports sending and receiving messages to Amazon's SQS service.

PrerequisitesYou must have a valid Amazon Web Services developer account, and be signed up to use Amazon SQS. More information are available at Amazon SQS.

URI Format


aws-sqs://queue-name[?options]


The queue will be created if they don't already exists.
You can append query options to the URI in the following format, ?options=value&option2=value&...

URI Options



 Name 
 Default Value 
 Context 
 Description 


amazonSQSClient 
 null 
 Shared 
 Reference to a com.amazonaws.services.sqs.AmazonSQS in the Registry. 


accessKey 
 null 
 Shared 
 Amazon AWS Access Key 


secretKey 
 null 
 Shared 
 Amazon AWS Secret Key 


amazonSQSEndpoint 
 null 
 Shared 
 The region with which the AWS-SQS client wants to work with. Only works if Camel creates the AWS-SQS client, i.e., if you explicitly set amazonSQSClient, then this setting will have no effect. You would have to set it on the client you create directly 


attributeNames 
 null 
 Consumer 
 A list of attributes to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. 


defaultVisibilityTimeout 
 null 
 Shared 
 The visibility timeout (in seconds) to set in the com.amazonaws.services.sqs.model.CreateQueueRequest. 


deleteAfterRead 
 true 
 Consumer 
 Delete message from SQS after it has been read 


deleteIfFiltered 
 true 
 Consumer 
 Camel 2.12.2,2.13 Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. 


maxMessagesPerPoll
 null 
 Consumer 
 The maximum number of messages which can be received in one poll to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. 


visibilityTimeout 
 null 
 Shared 
 The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. This only make sense if its different from defaultVisibilityTimeout. It changes the queue visibility timeout attribute permanently. 


messageVisibilityTimeout 
 null 
 Consumer 
 Camel 2.8: The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. It does NOT change the queue visibility timeout attribute permanently. 


 extendMessageVisibility 
 false 
 Consumer 
 Camel 2.10: If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it taks a long time to process the message. If set to true defaultVisibilityTimeout must be set.  See details at Amazon doc

[CONF] Apache Camel > AWS-SQS

2013-10-14 Thread Christian Posta (Confluence)







AWS-SQS
Page edited by Christian Posta


 Changes (1)
 




...
|defaultVisibilityTimeout | {{null}} | Shared | The visibility timeout (in seconds) to set in the {{com.amazonaws.services.sqs.model.CreateQueueRequest}}. | |deleteAfterRead | {{true}} | Consumer | Delete message from SQS after it has been read | 
|deleteIfFiltered | {{true}} | Consumer | *Camel 2.12.2,2.13.0* Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. | 
|maxMessagesPerPoll| {{null}} | Consumer | The maximum number of messages which can be received in one poll to set in the {{com.amazonaws.services.sqs.model.ReceiveMessageRequest}}. | |visibilityTimeout | {{null}} | Shared | The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the {{com.amazonaws.services.sqs.model.SetQueueAttributesRequest}}. This only make sense if its different from {{defaultVisibilityTimeout}}. It changes the queue visibility timeout attribute permanently. | 
...


Full Content

SQS Component
Available as of Camel 2.6

The sqs component supports sending and receiving messages to Amazon's SQS service.

PrerequisitesYou must have a valid Amazon Web Services developer account, and be signed up to use Amazon SQS. More information are available at Amazon SQS.

URI Format


aws-sqs://queue-name[?options]


The queue will be created if they don't already exists.
You can append query options to the URI in the following format, ?options=value&option2=value&...

URI Options



 Name 
 Default Value 
 Context 
 Description 


amazonSQSClient 
 null 
 Shared 
 Reference to a com.amazonaws.services.sqs.AmazonSQS in the Registry. 


accessKey 
 null 
 Shared 
 Amazon AWS Access Key 


secretKey 
 null 
 Shared 
 Amazon AWS Secret Key 


amazonSQSEndpoint 
 null 
 Shared 
 The region with which the AWS-SQS client wants to work with. Only works if Camel creates the AWS-SQS client, i.e., if you explicitly set amazonSQSClient, then this setting will have no effect. You would have to set it on the client you create directly 


attributeNames 
 null 
 Consumer 
 A list of attributes to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. 


defaultVisibilityTimeout 
 null 
 Shared 
 The visibility timeout (in seconds) to set in the com.amazonaws.services.sqs.model.CreateQueueRequest. 


deleteAfterRead 
 true 
 Consumer 
 Delete message from SQS after it has been read 


deleteIfFiltered 
 true 
 Consumer 
 Camel 2.12.2,2.13.0 Whether or not to send the DeleteMessage to the SQS queue if an exchange fails to get through a filter. If 'false' and exchange does not make it through a Camel filter upstream in the route, then don't send DeleteMessage. 


maxMessagesPerPoll
 null 
 Consumer 
 The maximum number of messages which can be received in one poll to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. 


visibilityTimeout 
 null 
 Shared 
 The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. This only make sense if its different from defaultVisibilityTimeout. It changes the queue visibility timeout attribute permanently. 


messageVisibilityTimeout 
 null 
 Consumer 
 Camel 2.8: The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.ReceiveMessageRequest. It does NOT change the queue visibility timeout attribute permanently. 


 extendMessageVisibility 
 false 
 Consumer 
 Camel 2.10: If enabled then a scheduled background task will keep extending the message visibility on SQS. This is needed if it taks a long time to process the message. If set to true defaultVisibilityTimeout must be set.  See details at Amazon docs. 


maximumMessageSize 
 null 
 Shared 
 Camel 2.8: The maximumMessageSize (in bytes) an SQS message can contain for this queue, to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. 


messageRetentionPeriod 
 null 
 Shared 
 Camel 2.8: The messageRetentionPeriod (in seconds) a message will be retained by SQS for this queue, to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. 


policy 
 null 
 Shared 
 Camel 2.8: The policy for this queue to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. 


delaySeconds 
 null 
 Producer 
 Camel 2.9.3: Delay send

svn commit: r882557 - in /websites/production/camel/content: cache/main.pageCache splunk.html

2013-10-14 Thread buildbot
Author: buildbot
Date: Mon Oct 14 15:19:23 2013
New Revision: 882557

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/splunk.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/splunk.html
==
--- websites/production/camel/content/splunk.html (original)
+++ websites/production/camel/content/splunk.html Mon Oct 14 15:19:23 2013
@@ -145,6 +145,21 @@
 
  Name  Default Value  Context  Description host  localhost  Both  Splunk host.port  8089  Both  Splunk port username  null 
  Both  Username for 
Splunk password 
 null  Both  Password for Splunk connectionTimeout  5000  Both  Timeout in MS when connecting to Splunk 
server 
useSunHttpsHandler  false 
 Both  Use 
sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk 
Connection.
  Can be useful when running in application servers to avoid app. server https 
handling. index 
 null  Producer  Splunk index to write to sourceType  null  Producer  Splunk SourceType arguement source  null  Producer  Splunk Source arguement tcpReceiverPort  0  Producer  Splunk tcp reciever port when using tcp producer 
endpoint. 
initEarliestTime  null 
 Consumer  Initial start offset of the first 
search. Required 
earliestTime  null 
 Consumer  Earliest time of the search time 
window. 
latestTime  null  Consumer  Latest time of the search time window. count  0  Consumer  A number that indicates the maximum number of entities to 
return. Note this is not the same as maxMessagesPerPoll which currently is 
unsupported 
search null  Consumer  The Splunk query to run savedSearch  null  Consumer  The name of the query 
saved in Splunk to run
 
+
+
+Use Cases
+Search Twitter for tweets with music and publish events to Splunk
+
+
+
+
+
+Splunk comes with a variety of options for leveraging machine generated 
data with prebuild apps for analyzing and displaying this. 
+For example the jmx app. could be used to publish jmx attributes, eg. route 
and jvm metrics to Splunk, and displaying this on a dashboard.
 
 
 




[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (1)
 




...
| search |null | Consumer | The Splunk query to run | savedSearch | null | Consumer | The name of the query saved in Splunk to run 
 h3. Use Cases Search Twitter for tweets with music and publish events to Splunk {code}   from("twitter://search?type=polling&keywords=music&delay=10&consumerKey=abc&consumerSecret=def&accessToken=hij&accessTokenSecret=xxx") .convertBodyTo(SplunkEvent.class) .to("splunk://submit?username=foo&password=bar&index=camel-tweets&sourceType=twitter&source=music-tweets"); {code}   Splunk comes with a variety of options for leveraging machine generated data with prebuild apps for analyzing and displaying this.  For example the jmx app. could be used to publish jmx attributes, eg. route and jvm metrics to Splunk, and displaying this on a dashboard.  


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode. When using stream mode be aware of that Splunk has some internal buffer (about 1MB or so) before events gets to the index. If you need realtime better use submit or tcp mode.  


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





When publishing events the message body should contain a SplunkEvent. 

Example


	from("direct:start").convertBodyTo(SplunkEvent.class).to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...


In this example a converter is required to convert to a SplunkEvent class. 

Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");



camel-splunk creates a route exchange per search result with a SplunkEvent in the body. 

URI Options



 Name 
 Default Value 
 Context 
 Description 


host 
 localhost 
 Both 
 Splunk host.


port 
 8089 
 Both 
 Splunk port


 username 
 null 
 Both 
 Username for Splunk


 password 
 null 
 Both 
 Password for Splunk


 connectionTimeout 
 5000 
 Both 
 Timeout in MS when connecting to Splunk server


 useSunHttpsHandler 
 false 
 Both 
 Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling.


 index 
 null 
 Producer 
 Splunk index to write to


 sourceType 
 null 
 Producer 
 Splunk SourceType arguement


 source 
 null 
 Producer 
 Splunk Source arguement


 tcpReceiverPort 
 0 
 Producer 
 Splunk tcp reciever port when using tcp producer endpoint.


 initEarliestTime 
 null 
 Consumer 
 Initial start offset of the first search. Required


 earliestTime 
 null 
 Consumer 
 Earliest time of the search time window.


 latestTime 
 null 
 Consumer 
 Latest time of the search time window.


 count 
 0 
 Consumer 
 A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported


 search 
null 
 Consumer 
 The Splunk query to run


 savedSearch 
 null 
 Consumer 
 The name of the query saved in Splunk to run





Use Cases
Search Twitter for tweets with music and publish events to Splunk


  from("twitter://search?type=polling&keywords=music&delay=10&consumerKey=abc&consumerSecret=def&accessToken=hij&accessTokenSecret=xxx")
.convertBodyTo(SplunkEvent.class)
.to("splunk://submit?username=foo&password=bar&index=camel-tweets&sourceType=twitter&source=music-tweets");




Splunk comes with a variety of options for leveraging machine generated data with prebuild apps for analyzing and displaying this. 
For example the jmx app. could be used to publish jmx attributes, eg. route and jvm metrics to Splunk, and displaying this on a dashboard.




Stop watching space
|
Change email notification preferences

View

svn commit: r882542 - in /websites/production/camel/content: cache/main.pageCache camel-2130-release.html splunk.html

2013-10-14 Thread buildbot
Author: buildbot
Date: Mon Oct 14 14:18:43 2013
New Revision: 882542

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2130-release.html
websites/production/camel/content/splunk.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2130-release.html
==
--- websites/production/camel/content/camel-2130-release.html (original)
+++ websites/production/camel/content/camel-2130-release.html Mon Oct 14 
14:18:43 2013
@@ -143,7 +143,7 @@
 
 
 Changes that may 
affect end users
-Components depending on Servlet API has been upgrade from Servlet API 
2.5 to 3.0Jetty upgraded from 7.6.x to 8.1.xHazelcast 
Component uses Object instead of String as the 
key.Hazelcast Component atomic number producer was using incorrect 
name (https://issues.apache.org/jira/browse/CAMEL-6833";>CAMEL-6833).  Name 
will be different with this release.Hazelcast 
Component instance consumer was incorrectly writing headers to the "out" 
message as opposed to the "in" message.  Headers are now written to the "in" 
message.Hazelcast Component map/multimap consumer
  were sending header value "envict" when an item was evicted.  This has been 
corrected and the value "evicted" is used now.The enum value 
NON_BLOCKING has been removed in camel-apns as its no longer 
support in APNS itself.
+Components depending on Servlet API has been upgrade from Servlet API 
2.5 to 3.0Jetty upgraded from 7.6.x to 8.1.xHazelcast 
Component uses Object instead of String as the 
key.Hazelcast Component atomic number producer was using incorrect 
name (https://issues.apache.org/jira/browse/CAMEL-6833";>CAMEL-6833).  Name 
will be different with this release.Hazelcast 
Component instance consumer was incorrectly writing headers to the "out" 
message as opposed to the "in" message.  Headers are now written to the "in" 
message.Hazelcast Component map/multimap consumer
  were sending header value "envict" when an item was evicted.  This has been 
corrected and the value "evicted" is used now.The enum value 
NON_BLOCKING has been removed in camel-apns as its no longer 
support in APNS itself.DefaultTimeoutMap must call 
start to initialize the map before use.
 
 
 Important 
changes to consider when upgrading

Modified: websites/production/camel/content/splunk.html
==
--- websites/production/camel/content/splunk.html (original)
+++ websites/production/camel/content/splunk.html Mon Oct 14 14:18:43 2013
@@ -115,12 +115,15 @@
 
 
 
+When publishing events the message body should contain a SplunkEvent. 
+
 Example
 
 
 
+In this example a converter is required to convert to a SplunkEvent class. 

 
 Consumer Endpoints: 

 
@@ -136,6 +139,8 @@
 ]]>
 
 
+camel-splunk creates a route exchange per search result with a SplunkEvent 
in the body. 
+
 URI Options
 
  Name  Default Value  Context  Description host  localhost  Both  Splunk host.port  8089  Both  Splunk port username  null 
  Both  Username for 
Splunk password 
 null  Both  Password for Splunk connectionTimeout  5000  Both  Timeout in MS when connecting to Splunk 
server 
useSunHttpsHandler  false 
 Both  Use 
sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk 
Connection.
  Can be useful when running in application servers to avoid app. server https 
handling. index 
 null  Producer  Splunk index to write to sourceType  null  Producer  Splunk SourceType arguement source  null  Producer  Splunk Source arguement tcpReceiverPort  0  Producer  Splunk tcp reciever port when using tcp producer 
endpoint. 
initEarliestTime  null 
 Consumer  Initial start offset of the first 
search. Required 
earliestTime  null 
 Consumer  Earliest time of the search time 
window. 
latestTime  null  Consumer  Latest time of the search time window. count  0  Consumer  A number that indicates the maximum number of entities to 
return. Note this is not the same as maxMessagesPerPoll which currently is 
unsupported 
search null  Consumer  The Splunk query to run savedSearch  null  Consumer  The name of the query 
saved in Splunk to run




[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (4)
 




...
| tcp   | tcp mode. Requires a open receiver port in Splunk.|  
When publishing events the message body should contain a SplunkEvent.   
*Example* {code} 
from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")... from("direct:start").convertBodyTo(SplunkEvent.class).to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")... 
{code} 
In this example a converter is required to convert to a SplunkEvent class.  
 
When publishing events the message body should contain a SplunkEvent.  
h3. Consumer Endpoints:   
...


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode. When using stream mode be aware of that Splunk has some internal buffer (about 1MB or so) before events gets to the index. If you need realtime better use submit or tcp mode.  


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





When publishing events the message body should contain a SplunkEvent. 

Example


	from("direct:start").convertBodyTo(SplunkEvent.class).to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...


In this example a converter is required to convert to a SplunkEvent class. 

Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");



camel-splunk creates a route exchange per search result with a SplunkEvent in the body. 

URI Options



 Name 
 Default Value 
 Context 
 Description 


host 
 localhost 
 Both 
 Splunk host.


port 
 8089 
 Both 
 Splunk port


 username 
 null 
 Both 
 Username for Splunk


 password 
 null 
 Both 
 Password for Splunk


 connectionTimeout 
 5000 
 Both 
 Timeout in MS when connecting to Splunk server


 useSunHttpsHandler 
 false 
 Both 
 Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling.


 index 
 null 
 Producer 
 Splunk index to write to


 sourceType 
 null 
 Producer 
 Splunk SourceType arguement


 source 
 null 
 Producer 
 Splunk Source arguement


 tcpReceiverPort 
 0 
 Producer 
 Splunk tcp reciever port when using tcp producer endpoint.


 initEarliestTime 
 null 
 Consumer 
 Initial start offset of the first search. Required


 earliestTime 
 null 
 Consumer 
 Earliest time of the search time window.


 latestTime 
 null 
 Consumer 
 Latest time of the search time window.


 count 
 0 
 Consumer 
 A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported


 search 
null 
 Consumer 
 The Splunk query to run


 savedSearch 
 null 
 Consumer 
 The name of the query saved in Splunk to run







Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel > Camel 2.13.0 Release

2013-10-14 Thread Claus Ibsen (Confluence)







Camel 2.13.0 Release
Page edited by Claus Ibsen


 Changes (1)
 




...
* [Hazelcast Component] map/multimap consumer were sending header value "envict" when an item was evicted.  This has been corrected and the value "evicted" is used now. * The enum value {{NON_BLOCKING}} has been removed in {{camel-apns}} as its no longer support in APNS itself. 
* {{DefaultTimeoutMap}} must call {{start}} to initialize the map before use. 
 h2. Important changes to consider when upgrading 
...


Full Content

Camel 2.13.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.13.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	When using multiple OSGi Blueprint 's then Camel now favors using non-default placeholders, or the last property-placeholder defined in the Blueprint XML file. This allows for example to define default properties in one placeholder, and override these values in other placeholders.
	FTP consumer allow to download a single named file without using the FTP LIST command. This allows to download a known file from a FTP server even when the user account does not have permission to do FTP LIST command.
	FTP consumer allow to ignore file not found or insufficient file permission errors.
	Data Format using marshal now leverages Stream caching out of the box if enabled, which allows to marshal big streams and spool to disk, instead of being pure in-memory based.
	Improved using Bean when the bean is looked up in the Registry, when using concurrent processing in the route.
	Added cache option to beanRef and  in the DSL. This avoids looking up the Bean from the Registry on each usage; this can safely be done for singleton beans.
	Configuring Data Formats in XML attributes now supports reference lookup using the # syntax, eg 
	JDBC component now also support outputType to specify the expected output as either a List or single Object. As well allow to map to a bean using a BeanRowMapper to control the mapping of ROW names to bean properties.
	Both Quartz as well as Quartz2 based ScheduledRoutePolicy has been improved to better support cluster setups (e.g. to not schedule jobs being already scheduled through another node inside a given cluster).
	Reduced the work the Aggregate EIP does while holding a lock during aggregation, which can lead to improved performance in some use-cases.
	JndiRegistry now implements all the find methods.
	VM component now supports multipleConsumers=true across deployment units.
	Added @PreConsumed to JPA consumer.



Fixed Issues


	Fixed an ArrayIndexOutOfBoundsException with Message History when using SEDA
	Fixed requestTimeout on Netty not triggering when we have received message.
	Fixed Parameter Binding Annotations on boolean types to evaluate as Predicate instead of _expression_
	Fixed using File consumer with delete=true&readLock=fileLock not being able to delete the file on Windows.
	Fixed Throttler to honor time slots after period expires (eg so it works consistently and as expected).
	Fixed getting JMSXUserID property when consuming from ActiveMQ
	Fixed interceptFrom to support property placeholders
	Fixed a race condition in initializing SSLContext in Netty and Netty HTTP
	Fixed using Recipient List, Routing Slip calling another route which is configured with NoErrorHandler, and an exception occurred in that route, would be propagated back as not-exhausted, allow the caller route to have its error handler react on the exception.
	Fixed Quartz and exception was thrown when scheduling a job, would affect during shutdown, assuming the job was still in progress, and not shutdown the Quartz scheduler.
	Fixed so you can configure Stomp endpoints using URIs



New Enterprise Integration Patterns

New Components


	camel-infinispan
	camel-splunk



New Camel Maven Archetypes


	camel-archetype-cxf-code-first-blueprint
	camel-archetype-cxf-contract-first-blueprint



New DSL

New Annotations

New Data Formats

New Languages


	JSonPath - To perform _expression_ and Predicate on json payloads.



New Examples

New Tutorials

API changes

Known Issues

Dependency Upgrades


	APNS 0.1.6 to 0.2.3
	BeanIO 2.0.6 to 2.0.7
	CXF 2.7.6 to 2.7.7
	EHCache 2.7.2 to 2.7.4
	Elasticsearch 0.20.6 to 0.90.3
	FOP 1.0 to 1.1
	Guave 14.0.1 to 15.0
	Hazelcast 2.6 to 3.0.2
	ICal4j 1.0.4 to 1.0.5.2
	Jetty 7.6.9 to 8.1.12
	Joda time 2.1 to 2.3
	JRuby 1.7.4 to 1.7.5
	Lucene 3.6.0 to 4.4.0
	MongoDB Java Driver 2.11.2 to 2.11.3
	Quartz 2.2.0 to 2.2.1
	Restlet 2.0.15 to 2.1.4
	Saxon 9.5.0.2 to 9.5.1-2
	Servlet API 2.5 to 3.0
	SolrJ 3.6.2 to 4.4.0
	Spring Batch 2.2.1.RELEASE to 2.2.2.RELEASE
	Spring Redis 1.0.4.RELEASE to 1.1.0.RELEASE
	TestNG 6.8.5 to 6.8.7



Internal changes

	Add Rou

[3/3] git commit: CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and cancel the task

2013-10-14 Thread davsclaus
CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and 
cancel the task


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fed68b40
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fed68b40
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fed68b40

Branch: refs/heads/camel-2.11.x
Commit: fed68b407244fb21e91a2486477e3a6acf87ad56
Parents: 1765f1a
Author: Claus Ibsen 
Authored: Mon Oct 14 15:24:49 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 15:31:31 2013 +0200

--
 .../apache/camel/support/DefaultTimeoutMap.java | 12 --
 .../camel/support/DefaultTimeoutMapTest.java| 25 +++-
 2 files changed, 34 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fed68b40/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java 
b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
index 1b9d03f..4ca9c36 100644
--- a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
+++ b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -43,6 +44,8 @@ import org.slf4j.LoggerFactory;
  * You must provide a {@link java.util.concurrent.ScheduledExecutorService} in 
the constructor which is used
  * to schedule a background task which check for old entries to purge. This 
implementation will shutdown the scheduler
  * if its being stopped.
+ * You must also invoke {@link #start()} to startup the timeout map, before 
its ready to be used.
+ * And you must invoke {@link #stop()} to stop the map when no longer in use.
  *
  * @version 
  */
@@ -52,6 +55,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 
 private final ConcurrentMap> map = new 
ConcurrentHashMap>();
 private final ScheduledExecutorService executor;
+private volatile ScheduledFuture future;
 private final long purgePollTime;
 private final Lock lock = new ReentrantLock();
 private boolean useLock = true;
@@ -69,7 +73,6 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 this.executor = executor;
 this.purgePollTime = requestMapPollTimeMillis;
 this.useLock = useLock;
-schedulePoll();
 }
 
 public V get(K key) {
@@ -248,7 +251,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
  * lets schedule each time to allow folks to change the time at runtime
  */
 protected void schedulePoll() {
-executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
+future = executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
 }
 
 /**
@@ -276,10 +279,15 @@ public class DefaultTimeoutMap extends 
ServiceSupport implements TimeoutMa
 if (executor.isShutdown()) {
 throw new IllegalStateException("The ScheduledExecutorService is 
shutdown");
 }
+schedulePoll();
 }
 
 @Override
 protected void doStop() throws Exception {
+if (future != null) {
+future.cancel(false);
+future = null;
+}
 // clear map if we stop
 map.clear();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/fed68b40/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
index 51e0330..fcf52b8 100644
--- 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
@@ -31,15 +31,19 @@ public class DefaultTimeoutMapTest extends TestCase {
 
 private ScheduledExecutorService executor = new 
ScheduledThreadPoolExecutor(1);
 
-public void testDefaultTimeoutMap() {
+public void testDefaultTimeoutMap() throws Exception {
 DefaultTimeoutMap map = new DefaultTimeoutMap(executor);
+map.start();
 assertTrue(map.currentTime() > 0);
 
 assertEquals(0, map.size());
+
+map.stop();
 }
 
 p

[1/3] git commit: CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and cancel the task

2013-10-14 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 1765f1a2e -> fed68b407
  refs/heads/camel-2.12.x 0fc72e85a -> e7bf1703d
  refs/heads/master 45dea9ae5 -> 3a5ffd5a7


CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and 
cancel the task


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3a5ffd5a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3a5ffd5a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3a5ffd5a

Branch: refs/heads/master
Commit: 3a5ffd5a748371ba538b3986dd9f6f9df6f6df0e
Parents: 45dea9a
Author: Claus Ibsen 
Authored: Mon Oct 14 15:24:49 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 15:24:49 2013 +0200

--
 .../apache/camel/support/DefaultTimeoutMap.java | 12 --
 .../camel/support/DefaultTimeoutMapTest.java| 25 +++-
 2 files changed, 34 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3a5ffd5a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java 
b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
index 4f252fe..7dd60ee 100644
--- a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
+++ b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -43,6 +44,8 @@ import org.slf4j.LoggerFactory;
  * You must provide a {@link java.util.concurrent.ScheduledExecutorService} in 
the constructor which is used
  * to schedule a background task which check for old entries to purge. This 
implementation will shutdown the scheduler
  * if its being stopped.
+ * You must also invoke {@link #start()} to startup the timeout map, before 
its ready to be used.
+ * And you must invoke {@link #stop()} to stop the map when no longer in use.
  *
  * @version 
  */
@@ -52,6 +55,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 
 private final ConcurrentMap> map = new 
ConcurrentHashMap>();
 private final ScheduledExecutorService executor;
+private volatile ScheduledFuture future;
 private final long purgePollTime;
 private final Lock lock = new ReentrantLock();
 private boolean useLock = true;
@@ -69,7 +73,6 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 this.executor = executor;
 this.purgePollTime = requestMapPollTimeMillis;
 this.useLock = useLock;
-schedulePoll();
 }
 
 public V get(K key) {
@@ -248,7 +251,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
  * lets schedule each time to allow folks to change the time at runtime
  */
 protected void schedulePoll() {
-executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
+future = executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
 }
 
 /**
@@ -276,10 +279,15 @@ public class DefaultTimeoutMap extends 
ServiceSupport implements TimeoutMa
 if (executor.isShutdown()) {
 throw new IllegalStateException("The ScheduledExecutorService is 
shutdown");
 }
+schedulePoll();
 }
 
 @Override
 protected void doStop() throws Exception {
+if (future != null) {
+future.cancel(false);
+future = null;
+}
 // clear map if we stop
 map.clear();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/3a5ffd5a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
index 51e0330..fcf52b8 100644
--- 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
@@ -31,15 +31,19 @@ public class DefaultTimeoutMapTest extends TestCase {
 
 private ScheduledExecutorService executor = new 
ScheduledThreadPoolExecutor(1);
 
-public void testDefaultTimeoutMap() {
+public void testDefaultTimeoutMap() throws Exception {
 DefaultTimeoutMap map = new DefaultTimeoutMap(

[2/3] git commit: CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and cancel the task

2013-10-14 Thread davsclaus
CAMEL-6862: DefaultTimeoutMap - Should use start/stop to schedule the task, and 
cancel the task


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e7bf1703
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e7bf1703
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e7bf1703

Branch: refs/heads/camel-2.12.x
Commit: e7bf1703d5e73454bc947868ef95af5ee3dd1366
Parents: 0fc72e8
Author: Claus Ibsen 
Authored: Mon Oct 14 15:24:49 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 15:31:15 2013 +0200

--
 .../apache/camel/support/DefaultTimeoutMap.java | 12 --
 .../camel/support/DefaultTimeoutMapTest.java| 25 +++-
 2 files changed, 34 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e7bf1703/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java 
b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
index 4f252fe..7dd60ee 100644
--- a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
+++ b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -43,6 +44,8 @@ import org.slf4j.LoggerFactory;
  * You must provide a {@link java.util.concurrent.ScheduledExecutorService} in 
the constructor which is used
  * to schedule a background task which check for old entries to purge. This 
implementation will shutdown the scheduler
  * if its being stopped.
+ * You must also invoke {@link #start()} to startup the timeout map, before 
its ready to be used.
+ * And you must invoke {@link #stop()} to stop the map when no longer in use.
  *
  * @version 
  */
@@ -52,6 +55,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 
 private final ConcurrentMap> map = new 
ConcurrentHashMap>();
 private final ScheduledExecutorService executor;
+private volatile ScheduledFuture future;
 private final long purgePollTime;
 private final Lock lock = new ReentrantLock();
 private boolean useLock = true;
@@ -69,7 +73,6 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
 this.executor = executor;
 this.purgePollTime = requestMapPollTimeMillis;
 this.useLock = useLock;
-schedulePoll();
 }
 
 public V get(K key) {
@@ -248,7 +251,7 @@ public class DefaultTimeoutMap extends ServiceSupport 
implements TimeoutMa
  * lets schedule each time to allow folks to change the time at runtime
  */
 protected void schedulePoll() {
-executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
+future = executor.scheduleWithFixedDelay(this, 0, purgePollTime, 
TimeUnit.MILLISECONDS);
 }
 
 /**
@@ -276,10 +279,15 @@ public class DefaultTimeoutMap extends 
ServiceSupport implements TimeoutMa
 if (executor.isShutdown()) {
 throw new IllegalStateException("The ScheduledExecutorService is 
shutdown");
 }
+schedulePoll();
 }
 
 @Override
 protected void doStop() throws Exception {
+if (future != null) {
+future.cancel(false);
+future = null;
+}
 // clear map if we stop
 map.clear();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/e7bf1703/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
index 51e0330..fcf52b8 100644
--- 
a/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/support/DefaultTimeoutMapTest.java
@@ -31,15 +31,19 @@ public class DefaultTimeoutMapTest extends TestCase {
 
 private ScheduledExecutorService executor = new 
ScheduledThreadPoolExecutor(1);
 
-public void testDefaultTimeoutMap() {
+public void testDefaultTimeoutMap() throws Exception {
 DefaultTimeoutMap map = new DefaultTimeoutMap(executor);
+map.start();
 assertTrue(map.currentTime() > 0);
 
 assertEquals(0, map.size());
+
+map.stop();
 }
 
 p

[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (2)
 




...
{code}  
When publishing events the message body should contain a SplunkEvent.  
h3. Consumer Endpoints:   
...
{code}  
camel-splunk creates a route exchange per search result with a SplunkEvent in the body.   
h3. URI Options || Name || Default Value || Context || Description || 
...


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode. When using stream mode be aware of that Splunk has some internal buffer (about 1MB or so) before events gets to the index. If you need realtime better use submit or tcp mode.  


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





Example


	from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...



When publishing events the message body should contain a SplunkEvent.

Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");



camel-splunk creates a route exchange per search result with a SplunkEvent in the body. 

URI Options



 Name 
 Default Value 
 Context 
 Description 


host 
 localhost 
 Both 
 Splunk host.


port 
 8089 
 Both 
 Splunk port


 username 
 null 
 Both 
 Username for Splunk


 password 
 null 
 Both 
 Password for Splunk


 connectionTimeout 
 5000 
 Both 
 Timeout in MS when connecting to Splunk server


 useSunHttpsHandler 
 false 
 Both 
 Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling.


 index 
 null 
 Producer 
 Splunk index to write to


 sourceType 
 null 
 Producer 
 Splunk SourceType arguement


 source 
 null 
 Producer 
 Splunk Source arguement


 tcpReceiverPort 
 0 
 Producer 
 Splunk tcp reciever port when using tcp producer endpoint.


 initEarliestTime 
 null 
 Consumer 
 Initial start offset of the first search. Required


 earliestTime 
 null 
 Consumer 
 Earliest time of the search time window.


 latestTime 
 null 
 Consumer 
 Latest time of the search time window.


 count 
 0 
 Consumer 
 A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported


 search 
null 
 Consumer 
 The Splunk query to run


 savedSearch 
 null 
 Consumer 
 The name of the query saved in Splunk to run








Stop watching space
|
Change email notification preferences

View Online
|
View Changes









svn commit: r882530 - in /websites/production/camel/content: cache/main.pageCache splunk.html

2013-10-14 Thread buildbot
Author: buildbot
Date: Mon Oct 14 13:18:43 2013
New Revision: 882530

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/splunk.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/splunk.html
==
--- websites/production/camel/content/splunk.html (original)
+++ websites/production/camel/content/splunk.html Mon Oct 14 13:18:43 2013
@@ -106,7 +106,41 @@
 
-
+
+
+Producer Endpoints: 

+
+
+ Endpoint  Description stream streaming mode. When using stream mode be aware of that 
Splunk has some internal buffer (about 1MB or so) before events gets to the 
index. If you need realtime better use submit or tcp mode.   submit submit mode.   tcptcp mode. Requires a open receiver port in 
Splunk.
+
+
+
+Example
+
+
+
+
+Consumer Endpoints: 

+
+
+ Endpoint  Descriptionnormal  Performs normal search and requires a search query in the 
search option.realtimePerforms realtime search in Splunk and requires a search 
query in the search option.savedsearch Performs search based on a search query saved in splunk 
and requires the name of the query in the savedSearch 
option.
+
+
+
+Example
+
+
+
+
+URI Options
+
+ Name  Default Value  Context  Description host  localhost  Both  Splunk host.port  8089  Both  Splunk port username  null 
  Both  Username for 
Splunk password 
 null  Both  Password for Splunk connectionTimeout  5000  Both  Timeout in MS when connecting to Splunk 
server 
useSunHttpsHandler  false 
 Both  Use 
sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk 
Connection.
  Can be useful when running in application servers to avoid app. server https 
handling. index 
 null  Producer  Splunk index to write to sourceType  null  Producer  Splunk SourceType arguement source  null  Producer  Splunk Source arguement tcpReceiverPort  0  Producer  Splunk tcp reciever port when using tcp producer 
endpoint. 
initEarliestTime  null 
 Consumer  Initial start offset of the first 
search. Required 
earliestTime  null 
 Consumer  Earliest time of the search time 
window. 
latestTime  null  Consumer  Latest time of the search time window. count  0  Consumer  A number that indicates the maximum number of entities to 
return. Note this is not the same as maxMessagesPerPoll which currently is 
unsupported 
search null  Consumer  The Splunk query to run savedSearch  null  Consumer  The name of the query 
saved in Splunk to run
+
+
 
 
   




[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (7)
 




...
 || Endpoint || Description  
| stream| streaming mode. When using stream mode be aware of that Splunk has some internal buffer (about 1MB or so) before events gets to the index. If you need realtime better use submit or tcp mode.| 
| submit| submit mode.  | | tcp   | tcp mode. Requires a open receiver port in Splunk.| 
...
h3. URI Options || Name || Default Value || Context || Description || 
|host | localhost | Shared Both | The Splunk host. 
|port | 8089 | Shared Both | Splunk port 
| username | null | Shared | Mandatory Splunk username | password | null | Shared | Mandatory Splunk password 
| username | null | Both | Username for Splunk | password | null | Both | Password for Splunk 
| connectionTimeout | 5000 | Shared Both | Timeout in MS when connecting to Splunk server 
| useSunHttpsHandler | false | Shared Both | Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling. 
| index | null | Producer | Splunk index to write to | sourceType | null | Producer | Splunk SourceType arguement 
...


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode. When using stream mode be aware of that Splunk has some internal buffer (about 1MB or so) before events gets to the index. If you need realtime better use submit or tcp mode.  


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





Example


	from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...



Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");



URI Options



 Name 
 Default Value 
 Context 
 Description 


host 
 localhost 
 Both 
 Splunk host.


port 
 8089 
 Both 
 Splunk port


 username 
 null 
 Both 
 Username for Splunk


 password 
 null 
 Both 
 Password for Splunk


 connectionTimeout 
 5000 
 Both 
 Timeout in MS when connecting to Splunk server


 useSunHttpsHandler 
 false 
 Both 
 Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling.


 index 
 null 
 Producer 
 Splunk index to write to


 sourceType 
 null 
 Producer 
 Splunk SourceType arguement


 source 
 null 
 Producer 
 Splunk Source arguement


 tcpReceiverPort 
 0 
 Producer 
 Splunk tcp reciever port when using tcp producer endpoint.


 initEarliestTime 
 null 
 Consumer 
 Initial start offset of the first search. Required


 earliestTime 
 null 
 Consumer 
 Earliest time of the search time window.


 latestTime 
 null 
 Consumer 
 Latest time of the search time window.


 count 
 0 
 Consumer 
 A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported


 search 
null 
 Consumer 
 The Splunk query to run


 savedSearch 
 null 
 Consumer 
 The name of the query saved in Splunk to run







Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (1)
 




...
	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result"); {code} 
 h3. URI Options || Name || Default Value || Context || Description || |host | localhost | Shared | The Splunk host. |port | 8089 | Shared | Splunk port | username | null | Shared | Mandatory Splunk username | password | null | Shared | Mandatory Splunk password | connectionTimeout | 5000 | Shared | Timeout in MS when connecting to Splunk server | useSunHttpsHandler | false | Shared | Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling. | index | null | Producer | Splunk index to write to | sourceType | null | Producer | Splunk SourceType arguement | source | null | Producer | Splunk Source arguement | tcpReceiverPort | 0 | Producer | Splunk tcp reciever port when using tcp producer endpoint. | initEarliestTime | null | Consumer | Initial start offset of the first search. Required | earliestTime | null | Consumer | Earliest time of the search time window. | latestTime | null | Consumer | Latest time of the search time window. | count | 0 | Consumer | A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported | search |null | Consumer | The Splunk query to run | savedSearch | null | Consumer | The name of the query saved in Splunk to run 


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode.   


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





Example


	from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...



Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");



URI Options



 Name 
 Default Value 
 Context 
 Description 


host 
 localhost 
 Shared 
 The Splunk host.


port 
 8089 
 Shared 
 Splunk port


 username 
 null 
 Shared 
 Mandatory Splunk username


 password 
 null 
 Shared 
 Mandatory Splunk password


 connectionTimeout 
 5000 
 Shared 
 Timeout in MS when connecting to Splunk server


 useSunHttpsHandler 
 false 
 Shared 
 Use sun.net.www.protocol.https.Handler Https hanlder to establish the Splunk Connection. Can be useful when running in application servers to avoid app. server https handling.


 index 
 null 
 Producer 
 Splunk index to write to


 sourceType 
 null 
 Producer 
 Splunk SourceType arguement


 source 
 null 
 Producer 
 Splunk Source arguement


 tcpReceiverPort 
 0 
 Producer 
 Splunk tcp reciever port when using tcp producer endpoint.


 initEarliestTime 
 null 
 Consumer 
 Initial start offset of the first search. Required


 earliestTime 
 null 
 Consumer 
 Earliest time of the search time window.


 latestTime 
 null 
 Consumer 
 Latest time of the search time window.


 count 
 0 
 Consumer 
 A number that indicates the maximum number of entities to return. Note this is not the same as maxMessagesPerPoll which currently is unsupported


 search 
null 
 Consumer 
 The Splunk query to run


 savedSearch 
 null 
 Consumer 
 The name of the query saved in Splunk to run







Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (1)
 




...
  splunk://[endpoint]?[options] {code} 
 h3. Producer Endpoints:   || Endpoint || Description  | stream| streaming mode.   | | submit| submit mode.  | | tcp   | tcp mode. Requires a open receiver port in Splunk.|  *Example* {code} 	from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")... {code}  h3. Consumer Endpoints:   || Endpoint || Description  |normal | Performs normal search and requires a search query in the search option. |realtime   | Performs realtime search in Splunk and requires a search query in the search option. |savedsearch| Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.  *Example* {code} 	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result"); {code} 


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]



Producer Endpoints: 




 Endpoint 
 Description


 stream
 streaming mode.   


 submit
 submit mode.  


 tcp   
 tcp mode. Requires a open receiver port in Splunk.





Example


	from("direct:start").to("splunk://submit?username=user&password=123&index=myindex&sourceType=someSourceType&source=mySource")...



Consumer Endpoints: 




 Endpoint 
 Description


normal 
 Performs normal search and requires a search query in the search option.


realtime   
 Performs realtime search in Splunk and requires a search query in the search option.


savedsearch
 Performs search based on a search query saved in splunk and requires the name of the query in the savedSearch option.





Example


	from("splunk://normal?delay=5s&username=user&password=123&initEarliestTime=-10s&search=search index=myindex sourcetype=someSourcetype").to("direct:search-result");





Stop watching space
|
Change email notification preferences

View Online
|
View Changes









svn commit: r882525 - in /websites/production/camel/content: cache/main.pageCache splunk.html

2013-10-14 Thread buildbot
Author: buildbot
Date: Mon Oct 14 12:18:58 2013
New Revision: 882525

Log:
Production update by buildbot for camel

Added:
websites/production/camel/content/splunk.html
Modified:
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Added: websites/production/camel/content/splunk.html
==
--- websites/production/camel/content/splunk.html (added)
+++ websites/production/camel/content/splunk.html Mon Oct 14 12:18:58 2013
@@ -0,0 +1,207 @@
+http://www.w3.org/TR/html4/loose.dtd";>
+
+
+
+http://camel.apache.org/styles/site.css"; rel="stylesheet" 
type="text/css">
+http://camel.apache.org/styles/type-settings.css"; 
rel="stylesheet" type="text/css">
+http://camel.apache.org/styles/prototype.js"; 
type="text/javascript">
+http://camel.apache.org/styles/rico.js"; 
type="text/javascript">
+http://camel.apache.org/styles/site.js"; 
type="text/javascript">
+
+
+
+
+  .maincontent { overflow:hidden; }
+
+
+
+
+  
+  
+  
+  
+  
+  
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  
+
+
+Apache Camel: Splunk
+
+
+
+
+
+  
+
+
+  
+
+
+  
+
+  
+  
+
+   
+http://camel.apache.org/";>Camel
+http://www.apache.org";>Apache
+   
+
+  
+
+  
+
+Apache Camel > Splunk
+  
+  
+Download | JavaDoc | Source | Forums | Support
+  
+
+
+   
+   
+
+
+Splunk Component
+
+Available as of Camel 2.13
+
+The Splunk component provides access to http://splunk.com"; rel="nofollow">Splunk using 
the Splunk provided https://github.com/splunk/splunk-sdk-java"; rel="nofollow">client api, 
and it enables you to publish and search for events in Splunk.
+
+Maven users will need to add the following dependency to their pom.xml for 
this component:
+
+
+
+
+URI format 
+
+
+
+
+
+  
+
+
+Overview
+
+HomeDownloadGetting 
StartedFAQ
+
+
+Documentation
+
+User GuideManualBooksTutorialsExamplesCookbookArchitectureEnterprise Integration PatternsDSLComponentsData 
FormatL
 anguagesSecuritySecurity 
Advisories
+
+
+Search
+
+
+http://www.google.com/cse";>
+  
+
+
+
+
+  
+
+http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en";>
+
+
+Community
+
+SupportContributingDiscussion 
ForumsMailing ListsUser StoriesNewsArticlesSiteTeamhttp://camel-extra.googlecode.com/"; rel="nofollow">Camel 
Extra
+
+
+Developers
+
+Developer GuideSourceBuildingJavaDocIRC Room
+
+
+Apache 
Software Foundation
+
+http://www.apache.org/licenses/";>Licensehttp://www.apache.org/foundation/sponsorship.html";>Sponsorshiphttp://www.apache.org/foundation/thanks.html";>Thankshttp://www.apache.org/security/";>Security
+
+
+
+  
+
+
+   
+
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+Privacy Policy -
+(https://cwiki.apache.org/confluence/pages/editpage.action?pageId=34836117";>edit
 page)
+(https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34836117&showComments=true&showCommentArea=true#addcomment";>add
 comment)
+  
+
+  
+
+
+
+
+© 2004-2011 The Apache Software Foundation.
+  
+Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel 
project logo are trademarks of The Apache Software Foundation.  All other marks 
mentioned may be trademarks or registered trademarks of their respective owners.
+
+http://hiramchirino.com";>Graphic Design By Hiram
+
+
+
+
+
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-25976253-1']);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; 
ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(ga, s);
+  })();
+
+
+
+
+
+
+




[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (1)
 




...
*Available as of Camel 2.13*  
The Splunk component provides access to [Splunk|http://splunk.com] using the Splunk provided [client|https://github.com/splunk/splunk-sdk-java] api, and it enables you to publish and search for events in Splunk. 
 Maven users will need to add the following dependency to their pom.xml for this component: 
...


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and it enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]





Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page edited by Preben Asmussen


 Changes (2)
 




h2. Splunk Component 
 
*Available as of Camel 2.13*  The Splunk component provides access to [Splunk|http://splunk.com] using the Splunk provided client api, and enables you to publish and search for events in Splunk.  Maven users will need to add the following dependency to their pom.xml for this component: {code} 	 	org.apache.camel 	camel-splunk 	${camel-version} 	 {code}  h3. URI format  {code}   splunk://[endpoint]?[options] {code} 


Full Content

Splunk Component

Available as of Camel 2.13

The Splunk component provides access to Splunk using the Splunk provided client api, and enables you to publish and search for events in Splunk.

Maven users will need to add the following dependency to their pom.xml for this component:


	
	org.apache.camel
	camel-splunk
	${camel-version}
	



URI format 


  splunk://[endpoint]?[options]





Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel > Splunk

2013-10-14 Thread Preben Asmussen (Confluence)







Splunk
Page  added by Preben Asmussen

 

 


   
Stop watching space
|
Change email notification preferences

   View Online
   








[2/2] git commit: Fixed test when using AMQ 5.9.0

2013-10-14 Thread davsclaus
Fixed test when using AMQ 5.9.0


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0fc72e85
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0fc72e85
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0fc72e85

Branch: refs/heads/camel-2.12.x
Commit: 0fc72e85a8a539803e638edefe7d3f0bdd93246f
Parents: 4969138
Author: Claus Ibsen 
Authored: Mon Oct 14 11:20:55 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 11:22:10 2013 +0200

--
 .../apache/camel/component/jms/TwoConsumerOnSameQueueTest.java   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0fc72e85/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
--
diff --git 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
index 55f73db..ecc7ebe 100644
--- 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
+++ 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
@@ -18,11 +18,9 @@ package org.apache.camel.component.jms;
 
 import javax.jms.ConnectionFactory;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static 
org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
@@ -94,7 +92,7 @@ public class TwoConsumerOnSameQueueTest extends 
CamelTestSupport {
 protected CamelContext createCamelContext() throws Exception {
 CamelContext camelContext = super.createCamelContext();
 
-ConnectionFactory connectionFactory = new 
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); 
//CamelJmsTestHelper.createConnectionFactory();
+ConnectionFactory connectionFactory = 
CamelJmsTestHelper.createConnectionFactory();
 camelContext.addComponent("activemq", 
jmsComponentAutoAcknowledge(connectionFactory));
 
 return camelContext;



[1/2] git commit: Fixed test when using AMQ 5.9.0

2013-10-14 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x 4969138e3 -> 0fc72e85a
  refs/heads/master 47e76f104 -> 45dea9ae5


Fixed test when using AMQ 5.9.0


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/45dea9ae
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/45dea9ae
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/45dea9ae

Branch: refs/heads/master
Commit: 45dea9ae5a0c50ca8c5c16e84a3fb2a7f1a86e9b
Parents: 47e76f1
Author: Claus Ibsen 
Authored: Mon Oct 14 11:20:55 2013 +0200
Committer: Claus Ibsen 
Committed: Mon Oct 14 11:21:42 2013 +0200

--
 .../apache/camel/component/jms/TwoConsumerOnSameQueueTest.java   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/45dea9ae/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
--
diff --git 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
index 55f73db..ecc7ebe 100644
--- 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
+++ 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/TwoConsumerOnSameQueueTest.java
@@ -18,11 +18,9 @@ package org.apache.camel.component.jms;
 
 import javax.jms.ConnectionFactory;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static 
org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
@@ -94,7 +92,7 @@ public class TwoConsumerOnSameQueueTest extends 
CamelTestSupport {
 protected CamelContext createCamelContext() throws Exception {
 CamelContext camelContext = super.createCamelContext();
 
-ConnectionFactory connectionFactory = new 
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); 
//CamelJmsTestHelper.createConnectionFactory();
+ConnectionFactory connectionFactory = 
CamelJmsTestHelper.createConnectionFactory();
 camelContext.addComponent("activemq", 
jmsComponentAutoAcknowledge(connectionFactory));
 
 return camelContext;



[1/2] git commit: CAMEL-6861 fixed the camel-netty-http route cannot proxy the response which is chunked

2013-10-14 Thread ningjiang
Updated Branches:
  refs/heads/camel-2.12.x f4605be84 -> 4969138e3


CAMEL-6861 fixed the camel-netty-http route cannot proxy the response which is 
chunked


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fda70774
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fda70774
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fda70774

Branch: refs/heads/camel-2.12.x
Commit: fda70774947b9123ac425afa6a307988178aad2f
Parents: f4605be
Author: Willem Jiang 
Authored: Mon Oct 14 16:20:53 2013 +0800
Committer: Willem Jiang 
Committed: Mon Oct 14 16:42:21 2013 +0800

--
 .../netty/http/DefaultNettyHttpBinding.java |  5 
 .../http/handlers/HttpClientChannelHandler.java |  2 +-
 .../NettyHttpClientChunkedResponseTest.java | 30 
 3 files changed, 30 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fda70774/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
index e64b800..84d315b 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
@@ -346,6 +346,11 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding {
 }
 if (buffer != null) {
 response.setContent(buffer);
+// We just need to reset the readerIndex this time
+if (buffer.readerIndex() == buffer.writerIndex()) {
+buffer.setIndex(0, buffer.writerIndex());
+}
+// TODO How to enable the chunk transport 
 int len = buffer.readableBytes();
 // set content-length
 response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, len);

http://git-wip-us.apache.org/repos/asf/camel/blob/fda70774/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
index fc508e2..497ed45 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
@@ -85,7 +85,7 @@ public class HttpClientChannelHandler extends 
ClientChannelHandler {
 // the copy must not be readable when the content was chunked, 
so set the index to the end
 copy.setIndex(end, end);
 response.setContent(copy);
-// we the all the content now, so call super to process the 
received message
+// we get the all the content now, so call super to process 
the received message
 super.messageReceived(ctx, messageEvent);
 }
 } else if (msg instanceof HttpResponse) {

http://git-wip-us.apache.org/repos/asf/camel/blob/fda70774/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
--
diff --git 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
index 88cd3be..f9a6c4a 100644
--- 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
+++ 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
@@ -25,12 +25,22 @@ import org.junit.Test;
 
 public class NettyHttpClientChunkedResponseTest extends CamelTestSupport {
 
-private int port;
+private int port1;
+private int port2;
 
 @Test
 public void testNettyHttpClientChunked() throws Exception {
+invokeService(port1, true);
+}
+
+@Test
+public void testNettyHttpRouteClientChunked() throws Exception {
+invokeService(port2, false);
+}
+
+private void invokeService(int port, boolean checkChunkedHeader) {
 

[2/2] git commit: CAMEL-6860 supports parameterize encryption and hash algorithm in PGP Data Formater with thanks to Franz

2013-10-14 Thread ningjiang
CAMEL-6860 supports parameterize encryption and hash algorithm in  PGP Data 
Formater with thanks to Franz


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4969138e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4969138e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4969138e

Branch: refs/heads/camel-2.12.x
Commit: 4969138e39d7303048dd0ad2a3e1223943329206
Parents: fda7077
Author: Willem Jiang 
Authored: Mon Oct 14 16:27:10 2013 +0800
Committer: Willem Jiang 
Committed: Mon Oct 14 16:42:27 2013 +0800

--
 .../camel/converter/crypto/PGPDataFormat.java   | 45 +++-
 .../crypto/PGPDataFormatDynamicTest.java| 20 +
 .../converter/crypto/PGPDataFormatTest.java | 17 
 .../crypto/SpringPGPDataFormatTest.xml  |  1 +
 4 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4969138e/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
--
diff --git 
a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
 
b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
index eab0e71..e6d8921 100644
--- 
a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
+++ 
b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
@@ -84,6 +84,8 @@ public class PGPDataFormat extends ServiceSupport implements 
DataFormat {
 public static final String SIGNATURE_KEY_RING = 
"CamelPGPDataFormatSignatureKeyRing";
 public static final String SIGNATURE_KEY_USERID = 
"CamelPGPDataFormatSignatureKeyUserid";
 public static final String SIGNATURE_KEY_PASSWORD = 
"CamelPGPDataFormatSignatureKeyPassword";
+public static final String ENCRYPTION_ALGORITHM = 
"CamelPGPDataFormatEncryptionAlgorithm";
+public static final String SIGNATURE_HASH_ALGORITHM = 
"CamelPGPDataFormatSignatureHashAlgorithm";
 
 private static final Logger LOG = 
LoggerFactory.getLogger(PGPDataFormat.class);
 
@@ -109,6 +111,19 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 
 private boolean armored;
 private boolean integrity = true;
+
+/** Digest algorithm for signing (marshal).
+ * Possible values are defined in {@link HashAlgorithmTags}.
+ * Default value is SHA1.
+ */
+private int hashAlgorithm = HashAlgorithmTags.SHA1;
+
+/**
+ * Symmetric key algorithm for encryption (marschal).
+ * Possible values are defined in {@link SymmetricKeyAlgorithmTags}.
+ * Default value is CAST5.
+ */
+private int algorithm = SymmetricKeyAlgorithmTags.CAST5;
 
 public PGPDataFormat() {
 }
@@ -144,6 +159,14 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 protected String findSignatureKeyPassword(Exchange exchange) {
 return exchange.getIn().getHeader(SIGNATURE_KEY_PASSWORD, 
getSignaturePassword(), String.class);
 }
+
+protected int findAlgorithm(Exchange exchange) {
+return exchange.getIn().getHeader(ENCRYPTION_ALGORITHM, 
getAlgorithm(), Integer.class);
+}
+
+protected int findHashAlgorithm(Exchange exchange) {
+return exchange.getIn().getHeader(SIGNATURE_HASH_ALGORITHM, 
getHashAlgorithm(), Integer.class);
+}
 
 public void marshal(Exchange exchange, Object graph, OutputStream 
outputStream) throws Exception {
 PGPPublicKey key = 
PGPDataFormatUtil.findPublicKey(exchange.getContext(), 
findKeyFileName(exchange),
@@ -158,7 +181,7 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 outputStream = new ArmoredOutputStream(outputStream);
 }
 
-PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new 
JcePGPDataEncryptorBuilder(SymmetricKeyAlgorithmTags.CAST5)
+PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new 
JcePGPDataEncryptorBuilder(findAlgorithm(exchange))
 .setWithIntegrityPacket(integrity).setSecureRandom(new 
SecureRandom()).setProvider(getProvider()));
 encGen.addMethod(new JcePublicKeyKeyEncryptionMethodGenerator(key));
 OutputStream encOut = encGen.open(outputStream, new byte[BUFFER_SIZE]);
@@ -224,7 +247,7 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 
 int algorithm = sigSecretKey.getPublicKey().getAlgorithm();
 PGPSignatureGenerator sigGen = new PGPSignatureGenerator(
-new JcaPGPContentSignerBuilder(algorithm, 
HashAlgorithmTags.SHA1).setProvider(getProvider()));
+new JcaPGPContentSignerBuilder(algo

[1/2] git commit: CAMEL-6860 supports parameterize encryption and hash algorithm in PGP Data Formater with thanks to Franz

2013-10-14 Thread ningjiang
Updated Branches:
  refs/heads/master 32f32b94a -> 47e76f104


CAMEL-6860 supports parameterize encryption and hash algorithm in  PGP Data 
Formater with thanks to Franz


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/47e76f10
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/47e76f10
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/47e76f10

Branch: refs/heads/master
Commit: 47e76f1048063308504fbbae38105766c1ba1306
Parents: 9d7d54e
Author: Willem Jiang 
Authored: Mon Oct 14 16:27:10 2013 +0800
Committer: Willem Jiang 
Committed: Mon Oct 14 16:35:33 2013 +0800

--
 .../camel/converter/crypto/PGPDataFormat.java   | 45 +++-
 .../crypto/PGPDataFormatDynamicTest.java| 20 +
 .../converter/crypto/PGPDataFormatTest.java | 17 
 .../crypto/SpringPGPDataFormatTest.xml  |  1 +
 4 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/47e76f10/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
--
diff --git 
a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
 
b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
index eab0e71..e6d8921 100644
--- 
a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
+++ 
b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPDataFormat.java
@@ -84,6 +84,8 @@ public class PGPDataFormat extends ServiceSupport implements 
DataFormat {
 public static final String SIGNATURE_KEY_RING = 
"CamelPGPDataFormatSignatureKeyRing";
 public static final String SIGNATURE_KEY_USERID = 
"CamelPGPDataFormatSignatureKeyUserid";
 public static final String SIGNATURE_KEY_PASSWORD = 
"CamelPGPDataFormatSignatureKeyPassword";
+public static final String ENCRYPTION_ALGORITHM = 
"CamelPGPDataFormatEncryptionAlgorithm";
+public static final String SIGNATURE_HASH_ALGORITHM = 
"CamelPGPDataFormatSignatureHashAlgorithm";
 
 private static final Logger LOG = 
LoggerFactory.getLogger(PGPDataFormat.class);
 
@@ -109,6 +111,19 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 
 private boolean armored;
 private boolean integrity = true;
+
+/** Digest algorithm for signing (marshal).
+ * Possible values are defined in {@link HashAlgorithmTags}.
+ * Default value is SHA1.
+ */
+private int hashAlgorithm = HashAlgorithmTags.SHA1;
+
+/**
+ * Symmetric key algorithm for encryption (marschal).
+ * Possible values are defined in {@link SymmetricKeyAlgorithmTags}.
+ * Default value is CAST5.
+ */
+private int algorithm = SymmetricKeyAlgorithmTags.CAST5;
 
 public PGPDataFormat() {
 }
@@ -144,6 +159,14 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 protected String findSignatureKeyPassword(Exchange exchange) {
 return exchange.getIn().getHeader(SIGNATURE_KEY_PASSWORD, 
getSignaturePassword(), String.class);
 }
+
+protected int findAlgorithm(Exchange exchange) {
+return exchange.getIn().getHeader(ENCRYPTION_ALGORITHM, 
getAlgorithm(), Integer.class);
+}
+
+protected int findHashAlgorithm(Exchange exchange) {
+return exchange.getIn().getHeader(SIGNATURE_HASH_ALGORITHM, 
getHashAlgorithm(), Integer.class);
+}
 
 public void marshal(Exchange exchange, Object graph, OutputStream 
outputStream) throws Exception {
 PGPPublicKey key = 
PGPDataFormatUtil.findPublicKey(exchange.getContext(), 
findKeyFileName(exchange),
@@ -158,7 +181,7 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 outputStream = new ArmoredOutputStream(outputStream);
 }
 
-PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new 
JcePGPDataEncryptorBuilder(SymmetricKeyAlgorithmTags.CAST5)
+PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new 
JcePGPDataEncryptorBuilder(findAlgorithm(exchange))
 .setWithIntegrityPacket(integrity).setSecureRandom(new 
SecureRandom()).setProvider(getProvider()));
 encGen.addMethod(new JcePublicKeyKeyEncryptionMethodGenerator(key));
 OutputStream encOut = encGen.open(outputStream, new byte[BUFFER_SIZE]);
@@ -224,7 +247,7 @@ public class PGPDataFormat extends ServiceSupport 
implements DataFormat {
 
 int algorithm = sigSecretKey.getPublicKey().getAlgorithm();
 PGPSignatureGenerator sigGen = new PGPSignatureGenerator(
-new JcaPGPContentSignerBuilder(algorithm, 
HashAlgorithmTags.SHA1).setProvider(getProvider(

[2/2] git commit: CAMEL-6861 fixed the camel-netty-http route cannot proxy the response which is chunked

2013-10-14 Thread ningjiang
CAMEL-6861 fixed the camel-netty-http route cannot proxy the response which is 
chunked


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9d7d54e7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9d7d54e7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9d7d54e7

Branch: refs/heads/master
Commit: 9d7d54e770a6ea1019ee8a7a99da6c9abb726fce
Parents: 32f32b9
Author: Willem Jiang 
Authored: Mon Oct 14 16:20:53 2013 +0800
Committer: Willem Jiang 
Committed: Mon Oct 14 16:35:33 2013 +0800

--
 .../netty/http/DefaultNettyHttpBinding.java |  5 
 .../http/handlers/HttpClientChannelHandler.java |  2 +-
 .../NettyHttpClientChunkedResponseTest.java | 30 
 3 files changed, 30 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/9d7d54e7/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
index e64b800..84d315b 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/DefaultNettyHttpBinding.java
@@ -346,6 +346,11 @@ public class DefaultNettyHttpBinding implements 
NettyHttpBinding {
 }
 if (buffer != null) {
 response.setContent(buffer);
+// We just need to reset the readerIndex this time
+if (buffer.readerIndex() == buffer.writerIndex()) {
+buffer.setIndex(0, buffer.writerIndex());
+}
+// TODO How to enable the chunk transport 
 int len = buffer.readableBytes();
 // set content-length
 response.setHeader(HttpHeaders.Names.CONTENT_LENGTH, len);

http://git-wip-us.apache.org/repos/asf/camel/blob/9d7d54e7/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
index fc508e2..497ed45 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpClientChannelHandler.java
@@ -85,7 +85,7 @@ public class HttpClientChannelHandler extends 
ClientChannelHandler {
 // the copy must not be readable when the content was chunked, 
so set the index to the end
 copy.setIndex(end, end);
 response.setContent(copy);
-// we the all the content now, so call super to process the 
received message
+// we get the all the content now, so call super to process 
the received message
 super.messageReceived(ctx, messageEvent);
 }
 } else if (msg instanceof HttpResponse) {

http://git-wip-us.apache.org/repos/asf/camel/blob/9d7d54e7/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
--
diff --git 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
index 88cd3be..f9a6c4a 100644
--- 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
+++ 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/nettyhttp/NettyHttpClientChunkedResponseTest.java
@@ -25,12 +25,22 @@ import org.junit.Test;
 
 public class NettyHttpClientChunkedResponseTest extends CamelTestSupport {
 
-private int port;
+private int port1;
+private int port2;
 
 @Test
 public void testNettyHttpClientChunked() throws Exception {
+invokeService(port1, true);
+}
+
+@Test
+public void testNettyHttpRouteClientChunked() throws Exception {
+invokeService(port2, false);
+}
+
+private void invokeService(int port, boolean checkChunkedHeader) {
 Exchange out = template.request("netty-http:http://localhost:"; + port 
+ "