DirectoryScanner | PHP File Scanner -
kandi X-RAY | DirectoryScanner Summary
kandi X-RAY | DirectoryScanner Summary
PHP File Scanner
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DirectoryScanner
DirectoryScanner Key Features
DirectoryScanner Examples and Code Snippets
Community Discussions
Trending Discussions on DirectoryScanner
QUESTION
I have application that polls multiple directories and than it sends job requests to Sring Batch, every directory is registered as different Flow. Is it possible to run this in parallel? I have this use case, because every directory is connected to different business entity, and when flow is stuck with malformed file or mq broker for particular entity is not present, others need to continue working.
I registered flows with IntegrationFlowContext.
ANSWER
Answered 2022-Feb-01 at 14:20Yes. It is valid, possible and working use-case. The poller in Spring Integration relies on the TaskScheduler
and its thread pool. So, to be sure that all your parallel flows work, you need to make that thread pool big enough.
See docs for more info: https://docs.spring.io/spring-integration/docs/current/reference/html/configuration.html#namespace-taskscheduler
There is also a spring.integration.taskScheduler.poolSize
global integration property. (Next section in that doc).
If you use Spring Boot, see the TaskScheduler
auto-configuration: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.task-execution-and-scheduling
QUESTION
Actually I am creating a POC for running Spring integration With Kubernetes, and for that I created an integration flow that reads an XML file and move it to Processed Dir if it's a valid xml file otherwise move it to Error Dir
...ANSWER
Answered 2020-Sep-15 at 13:40Doesn't look like you test or verify anything in your readingInvalidFileAndMoveItToErrorDir()
at all. The fileReadingEndpoint.start();
is the last line of the test method.
Please, consider to investigate what is JUnit and how we should write test methods and what we should do to really verify async solutions like integration flow similar to yours: https://junit.org/junit5/docs/current/user-guide/
What I see so far is not good. The message source is about polling with some period. Your mockInvalidStudentFile
is about producing the same file all the time. Is it really expected in your solution? You probably can just consider to send your file direct to the channel the message source is configured for.
You don't need a fileReadingEndpoint.start();
since substituteMessageSourceFor()
does autostart up by default.
Your message after sending to the channel with the file as a payload is going to travel through the flow. You probably should see how you would verify the correctness of your logic in the test. Since you say that you drop the file in the end of the flow in some dir, so probably you should check that dir after sending. Maybe even using some loop or Awaitility: https://github.com/awaitility/awaitility.
Another way is to use a substituteMessageHandlerFor()
so you would place a MockMessageHandler
instead of your file writer to verify the file. Note: this is going to work if you send an original message directly to the channel, not as a mock MessageSource
origin and if you don't have thread shifting in your flow. So, all the flow is going to be performed in the same thread as your test method. If you have some async hand off in the flow, your MockMessageHandler
should do some CountDonwLatch
to make the test method to be blocked.
Saying all of these I mean that there are a lot of nuances with testing understanding which comes with the practice and experience. It is probably not possible to do some sample for your which could be useful for other people since there solution might be different and would require other testing approach.
Therefore my advice from here: do your best you know how you could test your own solution.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DirectoryScanner
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page