1. Home
  2. ...
  3. Triggers
  4. t SMB

t SMB

Available triggers

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

Main fields

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.445int
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.500long

Example

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):

  • Authenticates the share with username and password.
  • Defines the monitored directory through the path: "/" parameter (root of the share).
  • Configures the check interval with 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.

NOTE

The 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.

Result

How happy are you with this page?

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