1.Get started

This tutorial will give you a clear explanation on how to run Myddleware.

Firstly, we will detail all the set up process necessary to run Myddleware. Then we will explain how to handle data transfer errors.

2.User Creation

An admin user is automatically created during the installation of Myddleware . You can create other users if other people need access to Myddleware . So you will know who created a rule for example.

At  the moment the creation of users is done by command line. However, it will soon be possible to do it directly in Myddleware by an admin user.

To create a user, run the following command through a command prompt:

Create the user profile to connect to Myddleware. Change myddleware_username , myddleware_user_email , myddleware_password to the user you want to create:

php bin/console fos:user:create myddleware_username myddleware_user_email myddleware_password

If you want to add the administrator role to the user you just created, run this command:

php bin/console fos:user:promote myddleware_username ROLE_ADMIN

 

3.Email configuration

Myddleware is able to send notifications and alerts using scheduled task. For this, you have to configure your SMTP parameters here :

4.Error management

Data transfers can be rejected for different reasons : 

  • The target application isn’t available
  • Invalid data to send (invalid email for example)
  • A relate data transfert is also rejected, a queue is created

A rejected data transfer can be automatically reload using the job rerunerror (see cheduled task chapter). It can be also manually reloaded by clicking on the button «Reload» :

It is also possible to cancel a data transfer.

Finally, you can modify a data transfer in Myddleware by clicking on the field containing the invalid data. However it is always recommanded to modify invalid data in your source applicaion

Then you can reload the data transfer to send it to your target application.

5.Scheduled tasks

Myddleware can work with background tasks to sync your data, send notifications, clean data, and more.

If you wish to carry out this action, you will have to set up a background task using the crontab for Linux, or Widows task scheduler.

Before creating this task, make sure your configuration is correct, open a command shell and run the program symfony_requirements in the directory bin:

php bin/symfony_requirements

contab_1

Change your file permission or PHP configuration in case of permission error or missing PHP requirement :

contab_2

All you have to do is set up the “jobScheduler” scheduled task that will launch all the other Myddleware tasks:

cd <myddleware directory>; php bin/console myddleware:jobScheduler --env=background

This jobScheduler task will read the JobScheduler table and start the tasks according to the parameters of this table. You can manage this table directly in Myddleware

We draw your attention to the following columns:

  • Period: this is the time interval corresponding to the frequency of execution of this task. Caution: The frequency of the scheduled task must be greater than or equal to the frequency entered in the period field.
  • Order job: this is the order in which the tasks will be executed. The tasks with the smallest order will be executed first.
  • Active: Disables a scheduled task.

We will detail the different tasks in the following chapters that will enable you to fill the other columns.

 

5.1.Data Synchronization

The “synchro” program will allow you to synchronize your data by launching a specific rule or every active rules :

  • Command : synchro
  • Parameter 1 :Select all active rules or a specific rule.

Only active rules will be available in the list:

5.2.Reloading errors

The scheduled task “rerunerror” reloads transfers in error automatically.

  • Command : “rerunerror”
  • Parameter 1:  the maximum number of data transfers that the job will attempt to reload.
  • Parameter 2: the maximum number of times a transfer will be reloaded

In the above example, we have configured 2 tasks of reloading errors:

  • The first takes 100 maximum data transfers once per hour (60 minutes). This job will only take data transfers that have been reloaded at most 5 times.
  • The second takes 100 data transfers maximum once a day (1440 minutes). This job will only take data transfers that have been reloaded a maximum of 10 times.

5.3.Errors notification

The sheduled task “notification” allows you to send notifications and alerts or statistics by email.

  • Command : “notification”
  • Parameter 1 : alert or statistiques. If “alert” then the program will send alert if a scheduled task is blocked. If  “statistics”, the program will send the statistics (number of data transfer in error, number of data transfers successfully sent…)

In the above example, we have configured 2 tasks  :

  • The first checks every hour if a scheduled task is blocked. If yes, an email is sent to all administrators
  • The second one sends statistics every day.

Please make sure you have configured your SMTP parameters (see email configuration chapter).

5.4.Data clearing

The scheduled task “cleardata” deletes all the empty or expired data in Myddleware.

In the above example, we have configured a task that deletes empty or expired data in Myddleware :

  • Empty data corresponds to :
    • data transfer logs that carry no important information (all logs except error, new and send log) and are older than 7 days
    • tasks that have not performed any data transfer and are older than 7 days.
  • Expired data corresponds to the data transfers that have exceeded their validated date set in each rule.

  • Once the data has been cleaned up, all that remains are the IDs on the data transfers and the important logs (the log of creation, sending and possible errors) :

6.Myddleware shutdown

It can happen that your server stops or that your http service (apache for example) or MySQL encounters a problem. In these cases, Myddleware may be interrupted while it is running. Here’s how to make sure that Myddleware restarts properly once your server is restarted.

  • Check if Myddleware had a job in progress during the interruption
    • To do this, click on the list of tasks in Myddleware and check if a task is running and its start date is before the interruption:

  • Stop the task that could not be completed
  • If you have checked that a current job has a pre-interrupt start, this task will never stop automatically and will block the operation of Myddleware. It is therefore necessary to open this task and stop it:

Once the task is stopped, it will no longer block Myddleware, which will be able to function normally again.

Suggest Edit