Changes for page SMB Connectivity
Last modified by Danniar Firdausy on 2024/09/18 20:40
From version 8.1
edited by Bouke Reitsma
on 2024/05/06 10:29
on 2024/05/06 10:29
Change comment:
There is no comment for this version
To version 11.1
edited by Bouke Reitsma
on 2024/05/06 11:05
on 2024/05/06 11:05
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -28,91 +28,60 @@ 28 28 * Servers must be set up to run SMB services, and the client must have SMB software installed to access these services. 29 29 * eMagiz provides several components to set up the SMB connection 30 30 31 ------------------------------------------------------------------------------------------------------------------------------------ 32 - 33 33 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. 34 34 35 35 eMagiz provides only one support objects to connect to an SMB: 36 36 37 -* DefaultSMB session factory35 +* SMB session factory 38 38 39 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity- ftp-connectivity--ftp-support-objects.png]]37 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity--smb-support-object.png]] 40 40 41 -=== 3.1 Best practices forusingFTP===39 +=== 3.1 Configuration in eMagiz === 42 42 43 - ====3.1.1Whichsession factory doIneed?====41 +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: 44 44 45 -When occasionally retrieving or writing files to FTP, use the _Default FTP session factory_. A new connection will be set up when you use the _Default FTP session factory_ for every message/file. On some FTP servers, this might take up to seconds for each login. This fact might impact the performance of your flow. 43 +* SMB inbound Channel adapter 44 +* SMB outbound Channel adapter 46 46 47 - Whenyou need better performance (say writing multiplefilesinaminuteorretrieving fileseveryminute), use the_Default FTP **caching**session factory_. The _DefaultFTP **caching** session factory_shares FTP sessions for messages in your flow.46 +On top of that, you need the following support objects. 48 48 49 - ====3.1.2DoI havetoset up aretrymechanism? ====48 +* SMB session factory 50 50 51 - Whenwritingfiles toFTP,itisadvisable tosetaretrymechanism.Findtheadvancedtabonyour_FTPoutboundchanneladapter_.Under_Request handleradvicechain_adda_RetryAdvice_.50 +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. 52 52 53 - ==== 3.1.3 I geta_Failedtolist files/items_or a_Failed toobtainpooleditem_.What canIdo?====52 +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. 54 54 55 - Incorrect connection settingscause this.Check whetherthecorrectproperties havebeenset andwhether the runtimehas retrievedthelatest properties.54 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity--smb-session-factory-empty.png]] 56 56 57 - ====3.1.4 I geta _Failed tolistfiles/ items_,a _Pipe closed_ or an _input stream is closed_. What can I do? ====56 +Here, we need to define the following: 58 58 59 -A closed FTP session can cause these notifications due to inactivity. For the _Default FTP **caching** session factory_, always set the _Server alive interval_ property to 30000 (ms). 58 +* Host 59 +* Port 60 +* Username 61 +* Password 60 60 61 - ====3.1.6Iget a_Failed towrite to_.WhatcanIdo?====63 +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. 62 62 63 - Maybethe target folderdoesnotexist, andthe_Auto-createdirectory_ is off. Itis also possiblethat theon settingsare incorrect. Check whether the correct properties have been set and whether the runtime hasretrieved the latest properties.65 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity--smb-session-factory-filled-in.png]] 64 64 65 - ====3.1.7Ioftenget'Disconnectingfromsftp.example.comport22'andthena'Caughtan exception, leavingmain loopdueoSocketclosed'warnings.====67 +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. 66 66 67 - Toomanyconnectionscancause this to the same server atthesametime.Ifyou have many flows connectingto thesameFTP server, ensure thattheronsdo nottrigger simultaneously.69 +Now that we have configured the support object adding the SMB inbound channel adapter to the flow has become time. 68 68 69 - ==== 3.1.8I'FailedreateSFTPClient' ====71 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity--smb-inbound-channel-adapter-empty.png]] 70 70 71 - SFTP,FTP,andFTPSare three different remote filetransferprotocolswith their_sessionfactory_componentsin theeMagizflowdesigner.Makesureyouusetheone thatcorrespondsto the server'sprotocol.73 +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. 72 72 73 - ==== 3.1.9 Onefmy remoteis notpicked up from theSFTP server (withoutany warning) ====75 +[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-smb-connectivity--smb-inbound-channel-adapter-filled-in.png]] 74 74 75 -The default local filter is _AcceptOnceFileListFilter_. This can be replaced by your file list filter on the _FTP inbound channel adapter's_. 76 -If every day you retrieve a file with the same filename and the _Delete remote files_ property is set, it is advised to use a different local filename. You can add the current timestamp, for example. 77 +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. 77 77 78 -=== =3.1.10Whichmodeis needed====79 +=== 3.2 SMB Gateway === 79 79 80 -When running in the current-generation architecture (G3) the FTP always needs to run **passive** mode. 81 81 82 -=== 3.2 Configuration in eMagiz === 83 83 84 -T o configuretheconnection between eMagiz andtheFTP, we need two(orthree) components. This depends on whetherwe want toread, write or do both while communicatingwiththe FTP. Ifwe're going to do both,we needbothfthe functionalcomponents.In all other scenarios, youonly need one ofthefunctional components. The functional components thatyoumight needare called:83 +This concludes our microlearning, in which we learned how to set up the connectivity with an SMB. 85 85 86 -* FTP Inbound Channel adapter 87 -* FTP Outbound Channel adapter 88 - 89 -On top of that, you need one of the following support objects. If you are unsure of which to use, please check out the information above in this microlearning. 90 - 91 -* Default FTP caching session factory 92 -* Default FTP session factory 93 - 94 -In this microlearning, we will use the FTP Inbound channel adapter combined with the Default FTP session factory to illustrate the configuration. Please note that any other combination works similarly. To configure the connection with the FTP, 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 FTP. 95 - 96 -When you have opened the flow, you need to enter "Start Editing" mode. After you have done so, we first add the support object to our flow. In this case, we will use the Default FTP session factory. 97 - 98 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-empty.png]] 99 - 100 -Here, we need to define at least the host and the port. Note that the username and password are optional for an FTP, which makes it less secure. Although in practice, we generally see that the FTP is secured with the help of a username-password combination. As a best practice, we use property references to fill in the various elements. 101 - 102 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--default-ftp-session-factory-filled-in.png]] 103 - 104 -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. 105 - 106 -Now that we have configured the support object adding the FTP inbound channel adapter to the flow has become time. 107 - 108 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-empty.png]] 109 - 110 -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. 111 - 112 -[[image:Main.Images.Microlearning.WebHome@intermediate-file-based-connectivity-ftp-connectivity--ftp-inbound-channel-adapter-filled-in.png]] 113 - 114 -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. This concludes our microlearning, in which we learned how to set up the connectivity with an FTP. 115 - 116 116 == 4. Key takeaways == 117 117 118 118 * FTP (File Transfer Protocol) is a network protocol for transmitting files between computers over Transmission Control Protocol/Internet Protocol (TCP/IP) connections.