SMB Connectivity

Version 12.1 by Bouke Reitsma on 2024/05/06 11:07

In some cases, there is no communication possible with a local file directory. Or there is a requirement from the external party to place the files somewhere else. Mainly the somewhere else is either an FTP or an SFTP. However, there is a third communication protocol that can be used for file transfer. In this microlearning we will take a look at Server Message Block (SMB) connectivity within eMagiz.

Should you have any questions, please get in touch with academy@emagiz.com.

1. Prerequisites

  • Basic knowledge of the eMagiz platform
  • Novice course on File-based connectivity

2. Key concepts

This microlearning is about SMB (connectivity).

By SMB connectivity, we mean: Making sure that eMagiz can communicate with the SMB protocol to exchange file-based data.

  • SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
  • In an SMB transaction, the end user's computer is typically called the localhost. The second computer involved in SMB is a remote host, which is usually a server.
  • Servers must be set up to run SMB services, and the client must have SMB software installed to access these services.
  • eMagiz provides several components to set up the SMB connection

3. SMB Connectivity

In some cases, there is no communication possible with a local file directory. Or there is a requirement from the external party to place the files somewhere else. Mainly the somewhere else is either an FTP or an SFTP. However, there is a third communication protocol that can be used for file transfer. In this microlearning we will take a look at Server Message Block (SMB) connectivity within eMagiz.

  • SMB (Server Message Block) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
  • In an SMB transaction, the end user's computer is typically called the localhost. The second computer involved in SMB is a remote host, which is usually a server.
  • Servers must be set up to run SMB services, and the client must have SMB software installed to access these services.
  • eMagiz provides several components to set up the SMB connection

So, where the file pickup component searches on the local host for the correct directory, the idea of the SMB setup is that the directory with whom to communicate exists on a remote host. The local host and the remote host can talk to each other via the SMB protocol. That is, in a nutshell, the difference between setting up an SMB connection and communicating with local directories.

eMagiz provides only one support objects to connect to an SMB:

  • SMB session factory

intermediate-file-based-connectivity-smb-connectivity-smb-support-object.png

3.1 Configuration in eMagiz

To configure the connection between eMagiz and the SMB, we need two (or three) components. This depends on whether we want to read, write or do both while communicating with the SMB. If we're going to do both, we need both of the functional components. In all other scenarios, you only need one of the functional components. The functional components that you might need are called:

  • SMB inbound Channel adapter
  • SMB outbound Channel adapter

On top of that, you need the following support objects.

  • SMB session factory

In this microlearning, we will use the SMB inbound channel adapter combined with the SMB session factory to illustrate the configuration. Please note that any other combination works similarly. To configure the connection with the SMB, we first navigate to the Create phase of eMagiz. Here we open the flow we want to edit. In this example, that will be an entry flow as we want to retrieve (read) data from the SMB.

When you have opened the flow, you need to enter "Start Editing" mode. After you have done so, we first add the SMB session factory support object to our flow.

intermediate-file-based-connectivity-smb-connectivity-smb-session-factory-empty.png

Here, we need to define the following:

  • Host
  • Port
  • Username
  • Password

As best practise, we also define the share and directory value. The value for this field is the main folder for your fileshare. In case the main folder is the exchange folder, this field should be empty and the main folder should be configured as remote directory in the SMB inbound Channel adapter.

intermediate-file-based-connectivity-smb-connectivity-smb-session-factory-filled-in.png

The settings on the Advanced tab don't have to be changed in most cases. If your specific setup does require a change to these settings, please consult the help texts on the component level for advice.

Now that we have configured the support object adding the SMB inbound channel adapter to the flow has become time.

intermediate-file-based-connectivity-smb-connectivity-smb-inbound-channel-adapter-empty.png

In this component, we need to define the remote directory where the original files are located. We need to specify the local directory used to store the files before they are processed temporarily. Furthermore, we need to link the support object we have just created and define a poller. For that last one, the best practice is the use of a cron trigger.

intermediate-file-based-connectivity-smb-connectivity-smb-inbound-channel-adapter-filled-in.png

Apart from these configurations, you could also add a filter, just as we learned in the Crash Course Messaging on file-based connectivity. Finishing things off, we should consider the delete behavior we will use. Based on the filter and the business requirements, whether to delete and when to delete could differ. So please consider all your options in that regard.

3.2 SMB Gateway

This concludes our microlearning, in which we learned how to set up the connectivity with an SMB.

4. Key takeaways

  • FTP (File Transfer Protocol) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.
  • In an FTP transaction, the end user's computer is typically called the localhost. The second computer involved in FTP is a remote host, which is usually a server.
  • Servers must be set up to run FTP services, and the client must have FTP software installed to access these services.
  • eMagiz provides several components to set up the FTP connection

5. Suggested Additional Readings

If you are interested in this topic and want more information, please read the release notes provided by eMagiz. Furthermore, check out these links: