mardi 28 janvier 2014

[ESB open source] Introduction à Apache CAMEL (partie 6/6) : tutorial CAMEL


Poste réalisé par Mohamed Karim LILI (Ingénieur logiciel confirmé à OXIA)


Dans cet exemple (tiré du livre Camel in Action), nous créons un scénario qui consiste à copier un fichier d’un répertoire source vers un répertoire destination. 

De ce fait, nous allons comparer l’approche Java classique avec l’approche Camel en créant une route qui se charge de charger un fichier XML à partir d’un emplacement spécifique et de le copier vers un répertoire cible.

Commençons par lee fichier POM.xml du projet Maven (sans compter la partie pluginManagement maven):


Ensuite, on crée le deux fichiers java correspondants : FileCopier.java et le fichier FileCopierWithCamel.java :

FileCopier.java :
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package camelinaction;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class FileCopier {

    public static void main(String args[]) throws Exception {
        File inboxDirectory = new File("data/inbox");
        File outboxDirectory = new File("data/outbox");
       
        outboxDirectory.mkdir();
       
        File[] files = inboxDirectory.listFiles();
        for (File source : files) {
            if (source.isFile()) {
                File dest = new File(
                        outboxDirectory.getPath()
                        + File.separator
                        + source.getName());
                copyFile(source, dest);
            }
        }
    }
   
    private static void copyFile(File source, File dest)
        throws IOException {
        OutputStream out = new FileOutputStream(dest);
        byte[] buffer = new byte[(int) source.length()];
        FileInputStream in = new FileInputStream(source);
        in.read(buffer);
        try {
            out.write(buffer);
        } finally {
            out.close();     
            in.close();
        }
    }
}

Et le fichier FileCopierWithCamel.java :

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package camelinaction;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;


public class FileCopierWithCamel {

    public static void main(String args[]) throws Exception {
        // create CamelContext
        CamelContext context = new DefaultCamelContext();

        // add our route to the CamelContext
        context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("file:data/inbox?noop=true").to("file:data/outbox");
            }
        });

        // start the route and let it do its work
        context.start();
        Thread.sleep(10000);

        // stop the CamelContext
        context.stop();
    }
}

Bien entendu, n’oubliez pas de configurer le fichier « log4j.properties » sous « src/main/resources » et de créer un répertoire « data/inbox » à la racine du projet qui contient le fichier XML suivant qu’on nommera par exemple « message1.xml » :

xml version="1.0" encoding="UTF-8"?>
name="motor" amount="1" customer="honda"/>

vendredi 29 novembre 2013

OXIA sponsor officiel du SYMFONY Forum 2013 organisé par Symfony Community Tunisia


SYMFONYTN 2013 est un événement organisé par Symfony Tunisia community c’est une occasion unique d’échanger avec une équipe au cœur de Symfony.
Une rencontre avec des experts locaux et internationaux et aussi avec les chefs d'entreprises afin de pouvoir découvrir les fonctionnalités de Symfony, les usages les plus avancés ainsi que son évolution pour les années à venir.



SYMFONYTN 2013 se déroulera le 7 décembre 2013 à la cité des sciences de Tunis au sein du grand auditorium Ibn Khaldoun. Situé au cœur de Tunis, ce lieu offre une atmosphère dynamique stimulant l’interaction entre les participants, les conférenciers et les sponsors.

Les conférences vont se succéder de 9h00 à 17h00, avec une pause déjeuner qui s’effectuera aux environs de 12h.
Cette initiative est sponsorisée par OXIA, Talan, Karismatik, Times university et Tritux.SYMFONYTN 2013:
•Le premier Évènement en Tunisie concernant la Framework Symfony.
•Il s’agit d’un événement unique permettant de rencontrer de nombreux développeurs Symfony venus de toute la Tunisie.
•C’est l’occasion d’entrer en contact avec des développeurs web et des managers à forte influence qui travaillent avec Symfony.

L'inscription pour accéder à l'événement est gratuite et sera ouverte bientôt sur le site www.symfony-tunisia.com
Pour plus de détails rendez-vous sur le site www.symfony-tunisia.com ou nous contacter par mail:contact@symfony-tunisia.com

jeudi 7 novembre 2013

Conférence du 12/11/13 : L’open source catalyseur de l’innovation dans l’industrie du M2M (Machine to Machine)

Le Titre : L’open source catalyseur de l’innovation dans l’industrie du M2M (Machine to Machine)
Le cadre : 8ème Conférence nationale sur les logiciels Open Source en Tunisie, 
Date : le 12 Novembre 2013 
Heure : 14h00 
Lieu : l'hôtel La Medina, Hammamet
Résumé : 
La prochaine grande révolution de l’IT se profile à travers le concept générique de l'Internet des objets (IoT) et se concrétise dans la pratique dans l’industrie dite M2M (Machine to Machine). 
Mais la grande majorité des solutions M2M actuelles sont propriétaires et ne sont pas compatibles entre elles, bien que le point commun entre elles qu’est l'Internet a été un succès car il a été bâtit sur les deux piliers de l’innovation dans l’IT qui sont les standards ouverts et l’open source.
La conférence mettra en exergue l’émergence d‘une communauté open source pour l'industrie M2M et l'Internet des objets à travers trois idées clés :
  • .       L’apparition du modèle de « matériel open source » (Arduino, Raspberry Pi et Beagle board …) permettra de créer des projets open source qui fonctionnent sur du matériel à faible coût et accessible indépendant des fournisseurs.
  • .       La communauté open source commence à fournir les  briques logicielles de référence pour le développement de solutions M2M : le projet Eclipse M2M (Koneki, Mihini, paho) sous l'impulsion de SierraWirelss, le framework de communication DeviceHive ou des plateforme M2M Mango et enfin le protocole d’échange MQTT
  • .       Finalement l’émergence de réponse open source crédible de la technologie opendata à traves Hadoop et autres base de données traitant des gros volumes de données évitent que les formats propriétaires condamnent la croissance du marché M2M et brident l’innovation dans des considérations de licences et de brevets 





lundi 23 septembre 2013

3rd Arab Forum : "E-transactions Security & Public Key Infrastructure" By Arab ICT Organization

Arab ICT Organization In cooperation with The National Digital Certification Agency &  The National Agency for Computer Security the
3rd Arab Forum : "E-transactions Security & Public Key Infrastructure"
Date  : 25  September 2013 –
Place :  ‘Le Palace’ hotel, Gammarth -Tunisia



08:30 – 09:00      Registration
09:00 – 09:30      Official opening
09:30 – 10:00      Keynote speech     «PKI : state of the art and future trends»
10:00 – 10:45      Panel 1                  «Case studies of PKI deployment in the Arab region & worldwide»

Moderator : -      Mr. Alaa-Al-Din Al-Radhi -  international expert in ICT - Iraq
-          Mr. Ramzi Khlif, head of  e-certification division, The National Digital Certification Agency, Tunisia
-          Mrs. Safae EL ALAOUI., Project Manager Digital Trust– Morocco
-          Mr. .HAITHAM MOHAMED ABDELGADIR AMIR, National Telecommunications Corporation– Sudan
-          Mr. Khalid Moftah kammou, General Manager, National Information Security and Safety Authority - Libya
10:45 – 11:15      Panel 2                  «Overview of PKI developments & services»
                                               
      (e-ID, mobile  PKI, Cloud Computing, Open data)
Moderator : -                   Mr. Khaled Bendriss, CTO, OXIA - TUNISIA
-          Mr. Khaled Sellami, Director General e-government Unit, Prime ministry, Tunisia
-          Mr. Gilles Kauer, Sales executive, PrimeKey – Sweden
-          Mr Radwan Chabbi, Regional Channel Manager, Keynectis – France
-          Mr Hussam Barhoush, Project Manager, Arab Advisors Group –Jordan
-          Mr. Khaled zarg elayoun, executive Manager, Monétique- Tunisia

11:15 – 11:30      Coffee break
11:30 – 12:00      Panel 3                        «E-transactions security and infrastructure protection»
Moderator : -                     Mr. Faycal HOUAS, Director General, Onetech Business Solutions,Tunisia
-          Dr. Hella kaffel Ben Ayed, Assistant-Professor, Faculty of Sciences of Tunis, El Manar University - Tunisia
-          Prof. David Chadwick, Information Systems Security, the University of Kent– England
-          Mr. Ali GHRIB, General Manager, The National Agency for Computer Security – TUNISIA
-          Mr. Mohamed zouhaier , Project Manager  CCPnet, Tunisian Post- Tunisia
-          Mr. Jamel Sakka , Tunisie Telecom - Tunisia
12:00 – 12:30      Panel 4                        « The legal and regulatory framework»
Moderator : -   Prof. Dr. . Mohamed Hamouda, Advocate Court of Cassation, Director of doctoral school , Faculty of Law & Political Sciences of Tunis
-          Mr. Jae Sung LEE, Legal Officer, International Trade Law Division – UNCITRAL
-          Mr . Chemseddine Ethani Barnat, , Assistant-Professor, Higher school of digital economy Tunisia

12:30 – 13:15       Round table          « Launching the Arab PKI forum »


13:15 – 13:30      Closing & recommendations              

Architecte SOA & Professionnel Open Source Headline Animator

 
Khaled BEN DRISS
Cloud Computing, SOA et Web 2.0 : Des sujets techniques sur SOA et l'Open Source : de Java & .Net, PHP5, Symfony, à SaaS / PaaS en passant par Azure, google appengine, le BPM, la Modélisation et d'autres sujets du coté du serveur et cloud computing.