The SMB component allows you to integrate the flow with directories shared via SMB/CIFS protocol, enabling the sending of files directly to a remote server.
The integration supports sending multiple files in a single execution and allows configuring control parameters and message headers to customize the processing and routing of sent files.
URI Syntax: smb:hostname:port/shareName
Path parameters
Name | Description | Default | Type |
|---|---|---|---|
hostname (common) | (required) The hostname or IP address of the share. | — | String |
port (common) | The port number of the share. | 445 | int |
shareName (common) | (required) The name of the shared directory. | — | String |
path (common) | Base directory within the share. | — | String |
Query parameters
Name | Description | Default | Type |
|---|---|---|---|
password (security) | The password to access the share. | — | String |
username (security) | The username required to access the share. | — | String |
delay (scheduler) | Milliseconds before the next poll. | 500 | long |
The flow below reads files from an SMB server:
The flow starts by making a connection to the SMB server using the URI smb:ec2-18-207-116-134.compute-1.amazonaws.com:445/myshare (server + port + share):
username and password.path: "/" parameter (root of the share).delay: 60000 (checks for new files every 60 seconds).Then, it logs the detected file, displaying the name via ${header.CamelFileName}.
Next, it converts the SMB object to a stream using setBody with ${body.getInputStream()} to make the content readable.
Finally, it displays the already converted content in another log.
NOTEThe body generated by the consumer is of type "com.hierynomus.smbj.share.File", which does not have native integration with Camel. Therefore, the "getInputStream()" method is used to get the data stream (stream) of the content and allow its consumption.

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more