I have a service of class EnsLib.HL7.Service.FTPService that picks up files from multiple subfolders and sends them to an EnsLib.HL7.MsgRouter.RoutingEngine. What I want to do is somehow capture the subfolder as a variable for use in the routing rules. Is this possible?
Let's say I have the following files and directory structure on my FTP Server
/incoming/green/apple.dat
/incoming/yellow/banana.dat
I want the Routing Rule to be able to send anything that came from the /green/ folder to one operation and from /yellow/ to another.
With a message viewer, you can trace any messages. Where you can see any message properties, and one of them is Source. Text in this property looks like:
Source apple.dat via FTP localhost:21 path '/incoming/green/'
So with all of this data, you can create a rule by this property in a Rule editor
Related
I am trying to create a flow in Power Automate Cloud that allows me to extract some files from Google Drive and copy them to a Sharepoint folder. But before copying it, it has to check by the file name, that the file does not already exist in the sharepoint folder. I have managed to do the whole flow, except the checking.
I would be very grateful for your help.
Thank you very much. Best regards.
A File exists action doesn't currently exist but you can use the Get file metadata using path action from the SharePoint connector to do the same sort of thing.
This flow below shows you an example of what you can do ...
For demonstration purposes, I've created an array with a list of file names (full path required) that I will then test the existence for.
One of those files doesn't exist.
I then loop through each one of those and try and get the metadata for each file.
If the resulting statusCode from the call to get the metadata is not equal to 200, then we know the file doesn't exist.
Examples ...
To make this work however, you need to make sure that the Condition step will execute after the metadata call no matter what the result.
Do this by making sure the Configure run after settings are correct ...
So after all of that, all you need to do is deal with the true and false sections of the condition.
I have a requirement where I want create different files from MQ messages based on the filename in the header. If a file is already existing in the folder location, the message in the queue should be appended to the contents of already existing file, else a new file should be created based on the filename in the header. I do not want to use File node because of some design constraint.
I have tried creating MQFTE monitor to test this requirement but the result is: if a file is not existing, a new file is getting created however an existing file is getting overwritten with the new message instead of appending. What would be the best way to address this?
Suppose a total of 50 users and one HTTP request/sampler were created so in that case we provide one input file when run Api then all 50 users use the same input files (same input file location )and some requests failed.
We want to make ideas or scripts for users to use different file locations so not chance to fail request or file not found exception.
You can parameterize the file name/location just like any other request parameter, username, etc.
The configuration element which is most frequently user for parameterization is CSV Data Set Config.
However if you don't want to manually manage the file content and protect yourself from "file not founds" it makes sense to consider going for Directory Listing Config plugin which reads the files in the given folder and stores them into a JMeter Variable so each thread/iteration will pick the next file from the pool.
You can install Directory Listing Config plugin using JMeter Plugins Manager
I am sending a HTTP request to upload a file. And the request is setup like this:
uploadFile
And, the Directory Listing plugin pointing to a directory with all files and the request picks one file at a time. It works fine when run with one thread but, when i run in multiple threads, i see that already uploaded file is picked again to upload which leads to error.
I have added regular expression extrator to get the filename from the request body like this:
extract-filename-from-requestbody
And then, I am trying to use a post processor beanshell script to either delete the file from the folder or move to a different folder. But, not been successful. Need some help on this.
The first issue is i am not sure if i am extracting the value the right way. The value is to be got from request body and not request header. But, i dont see that option in the extractor.
Second, i am unable to use/retrieve the value from the extractor. Tried vars.get, vars.getObject and simply "${fileName}". Nothing works.
I don't think that deleting the file will help because Directory Listing Config reads the folder at the beginning of the test (see Execution Order chapter) so no matter whether the file is physically present or not JMeter will try to upload it
If you want to get unique files without repetitions just untick "Rewind on end of list" box:
This way each virtual user will read the next value so there will be no duplicates. When the last file will be used - the test will stop.
More information: Introducing the Directory Listing Config Plugin on JMeter
Also going forward consider using JSR223 Test Elements and Groovy language instead of Beanshell, it's the recommended option since JMeter 3.1
I am using DotCMIS with no problem to connect to Alfresco and FileNet.
I registered for an IBM Connections account, added a few files via the web interface, and tried to connect to its CMIS endpoint https://greenhouse.lotus.com/files/basic/cmis/my/servicedoc
GetRepositories on this URL gives one repository, which in turn contain the two folders below:
My Files
My Folders
But when I run GetObjectByPath("/My Files") in the same repository, I get:
DotCMIS.Exceptions.CmisObjectNotFoundException was unhandled
Message=Not Found
Source=DotCMIS
ErrorContent=<?xml version="1.0" encoding="UTF-8"?><lcmis:error xmlns:lcmis="http://www.ibm.com/xmlns/prod/sn/cmis"><lcmis:code>objectNotFound</lcmis:code><lcmis:message>EJPVJ9023E: Unable to find object at path /My Files</lcmis:message><lcmis:userAction></lcmis:userAction></lcmis:error>
What does IBM Connections say Unable to find object at path /My Files despite My Files being a folder at the root of the repository?
The cmis:name property ("My Files", "My Folers") is localized. A non-English user would get different cmis:name property values for these two objects.
To fetch children from these resources, you need to build the path using the cmis:path property returned on each object or construct the path relative to its parent using the cmisra:pathSegment.
For example, the cmis:object for the resource labeled "My Files" in your scenario has the following:
<cmis:propertyString propertyDefinitionId="cmis:path"
localName="cmis_path" displayName="Path" queryName="cmis:path">
<cmis:value>/files</cmis:value>
</cmis:propertyString>
So to actually fetch the user's files, the path to call is the following:
GetObjectByPath("/files")
And to fetch the user's folders, the path to call is the following:
GetObjectByPath("/collections")
The net is to ensure you build paths using the cmisra:pathSegment or the cmis:path property, and not the cmis:name as this may not be valid in all scenarios (i.e. if the repository has same name siblings, etc.).