JEE App. Go To The Cloud

 

 

 

 

 

 

Enterprises are under pressure to deliver new applications fast; however, many factors, including rigid proprietary stacks, inflexible licensing agreements, and cultural silos in IT can prevent enterprises from achieving the agility they need to stay competitive. Enterprises are increasingly implementing DevOps methodologies, and technologies that complement them, to break down siloed communications between development and operations teams and accelerate application development and delivery. As DevOps adoption increases, so does the demand for technologies that complement DevOps methodologies and enable high productivity of developers and operations teams working closely together.

“Although DevOps emphasizes people (and culture) over tools and processes, implementation utilizes technology. As a result, Gartner, Inc. expects strong growth opportunities for DevOps toolsets, with the total for DevOps tools reaching $2.3 billion in 2015, up 21.1 percent from $1.9 billion in 2014. By 2016, DevOps will evolve from a niche strategy employed by large cloud providers to a mainstream strategy employed by 25 percent of Global 2000 organizations.”1

Red Hat is committed to helping enterprises get more out of their technology by allowing for greater freedom of choice. JBoss EAP supports a broad range of third-party frameworks, operating systems, databases, security, and identity systems to make integration into existing infrastructure easier. In addition, new subscription flexibility expands support for customers deploying JBoss EAP across multiple environments based on their individual needs and business requirements, including on-premise, in a Platform-as-a-Service (PaaS) environment, or in hybrid cloud scenarios.

Additional enhancements introduced in JBoss EAP 6.4 include:

  • Support for Java 8 applications, as well as for the Java API WebSockets implementation protocol, JSR 356, enabling developers to build real-time, rich client and mobile applications with reduced overhead and complexity.
  • Expanded JBoss EAP console and Red Hat Customer Portal integration, giving users direct access to the Red Hat Customer Portal, including the ability to receive support, open and manage tickets, and access the knowledge base.
  • New console functionality with an updated user interface enabling users to view log files more easily and manage security configuration for applications.
  • Kerberos authorization for greater application security.

As one of the only open source application platforms that commercially supports Java EE applications deployed in PaaS environments, JBoss EAP deployed on OpenShift provides developers with a fully certified Java EE 6 container and all the tools needed to build, run, and manage a wide range of Java applications. The combination of JBoss EAP and OpenShift Enterprise helps enterprises to optimize both development and operations by offering the ability to build enterprise-grade Java applications in a streamlined PaaS environment more quickly.

Ref :

http://www.redhat.com/en/about/press-releases/red-hat-expands-jboss-enterprise-application-platform-subscription-greater-flexibility-move-cloud

Kind Regards

Frederic

Advertisements

CloudAndApplication

 

  • Do you want to build and deliver Java™ EE apps faster?
  • Are your customers demanding more?
  • What if you could develop new business critical Java EE applications using your existing skills and deliver them faster?

http://www.youtube.com/watch?v=Iquk68o1Q-k

Learn how Red Hat accelerates application development and delivery, allowing you to get to market faster and deliver new features and value more frequently.

Learn more at :

Kind Regards
Frederic

Openshift @ University

 

 

The Middleware Services Group within Information Technology Services (ITS) at the University of North Carolina at Chapel Hill needed a comprehensive, dynamic solution for frequent server provisioning requests and, in particular, managed servers. Without such a solution, the likelihood that users would employ outside vendors significantly increased. Use of outside vendors would potentially increase security concerns, present additional costs, and further complicate system administration. Moving to a fully-interoperable Platform-as-a-Service (PaaS) offering, built on OpenShift Enterprise by Red Hat®, has allowed the middleware services team to deliver a flexible development and hosting environment that has fostered innovation and increased peace of mind.

Ref :

http://www.unc.edu/

http://www.redhat.com/en/resources/unc-chapel-hill-builds-open-development-and-hosting-environment-red-hat

http://www.redhat.com/en/technologies/platform-as-a-service

http://www.redhat.com/en/technologies/cloud-computing/openshift

KR

/f

Can Not Keep Up with Application Demand

 

 

 

 

 

 

 

 

 

 

When application requests start piling up, OpenShift Enterprise by Red Hat® can help you keep up with demand. This Platform-as-a-Service (PaaS) lets developers deploy on their time, optimizes your compute resources, and frees you up to focus on the future.

Enable your developers with velocity and stability.

Learn more at :

http://www.openshift.com

http://www.redhat.com/en/technologies/platform-as-a-service

http://www.redhat.com/en/technologies/cloud-computing/openshift

Kind Regards

Frederic

wildfly Camel

In one of my previous posts[1], I explain how you can install Apache Camel[2] on top of Wildfly[3].

In that small tutorial, I am not going to reinvent the wheel. I am just going to explain how you can transform/convert data stored in XML format and upload it to a database of your choice  – In this example H2[4] was the chosen default database -.

Note: H2 is not recommended to be used in production. I would rather recommend you to look at  postgresq[5], MongoDB[6], MariaDB[7], etc… instead.

This example named “camel-jpa”  is coming from the ones provided with the wildfly-camel project[8]

First of all here is the tree of that project :


[fhornain@localhost camel-jpa]$ tree
.
├── pom.xml
└── src
├── main
│   ├── java
│   │   └── org
│   │       └── wildfly
│   │           └── camel
│   │               └── examples
│   │                   └── jpa
│   │                       ├── CustomerRepository.java
│   │                       ├── JpaRouteBuilder.java
│   │                       ├── model
│   │                       │   ├── Customer.java
│   │                       │   └── package-info.java
│   │                       ├── Resources.java
│   │                       └── SimpleServlet.java
│   ├── resources
│   │   ├── META-INF
│   │   │   └── persistence.xml
│   │   └── org
│   │       └── wildfly
│   │           └── camel
│   │               └── examples
│   │                   └── jpa
│   │                       └── model
│   │                           └── jaxb.index
│   └── webapp
│       └── WEB-INF
│           ├── beans.xml
│           ├── customers.jsp
│           ├── customer.xml
│           └── jboss-web.xml
└── test
└── java
└── org
└── wildfly
└── camel
└── examples
└── jpa
└── JPAIntegrationTest.java

26 directories, 14 files

And here is the pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
 #%L
 Wildfly Camel :: Example :: Camel JPA
 %%
 Copyright (C) 2013 - 2014 RedHat
 %%
 Licensed 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.
 #L%
 -->


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>

 <parent>
 <groupId>org.wildfly.camel</groupId>
 <artifactId>wildfly-camel-example</artifactId>
 <version>2.0.0.CR1</version>
 </parent>

 <name>Wildfly Camel :: Example :: Camel JPA</name>

 <artifactId>example-camel-jpa</artifactId>
 <packaging>war</packaging>

 <dependencies>

 <!-- Provided -->
 <dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-core</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-cdi</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-jpa</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-jaxb</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>javax.enterprise</groupId>
 <artifactId>cdi-api</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.hibernate.javax.persistence</groupId>
 <artifactId>hibernate-jpa-2.1-api</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.jboss.spec.javax.servlet</groupId>
 <artifactId>jboss-servlet-api_3.1_spec</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.jboss.spec.javax.ejb</groupId>
 <artifactId>jboss-ejb-api_3.2_spec</artifactId>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>org.jboss.spec.javax.transaction</groupId>
 <artifactId>jboss-transaction-api_1.1_spec</artifactId>
 <scope>provided</scope>
 </dependency>

 <!-- Test Scope -->
 <dependency>
 <groupId>org.wildfly.camel</groupId>
 <artifactId>example-camel-common</artifactId>
 <version>${project.version}</version>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.jboss.arquillian.junit</groupId>
 <artifactId>arquillian-junit-container</artifactId>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.wildfly</groupId>
 <artifactId>wildfly-arquillian-container-remote</artifactId>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>junit</groupId>
 <artifactId>junit</artifactId>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>slf4j-simple</artifactId>
 <scope>test</scope>
 </dependency>
 </dependencies>

 <!-- Build -->
 <build>
 <plugins>
 <plugin>
 <groupId>org.wildfly.plugins</groupId>
 <artifactId>wildfly-maven-plugin</artifactId>
 <executions>
 <execution>
 <id>wildfly-deploy</id>
 <phase>integration-test</phase>
 <goals>
 <goal>deploy</goal>
 </goals>
 </execution>
 </executions>
 </plugin>
 </plugins>
 </build>

 <!-- Profiles -->
 <profiles>
 <profile>
 <id>ts.all</id>
 <activation>
 <property>
 <name>ts.all</name>
 </property>
 </activation>
 <properties>
 <jboss.home>${basedir}/../target/wildfly-${version.wildfly}</jboss.home>
 </properties>
 </profile>
 </profiles>
</project>

As you can see the project in based on a MVC pattern and is composed of four directories but for the time being we will only cover three of them.
That is to say :

- camel-jpa/src/main/java
- camel-jpa/src/main/resources
- camel-jpa/src/main/webapp

Indeed, the project can be then cut in two parts.

The first part which is taking care of the content routing and the transformation of information of the following XML data sample.


<?xml version="1.0" encoding="UTF-8"?>
<cus:customer xmlns:cus="http://org/wildfly/camel/examples/jpa/model/Customer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://org/wildfly/camel/examples/jpa/model/Customer">
<cus:firstName>John</cus:firstName>
<cus:lastName>Doe</cus:lastName>
<cus:dateOfBirth>1975-12-25</cus:dateOfBirth>
</cus:customer>

Note : You can retrieve these data in the camel-jpa/src/main/webapp/WEB-INF/customer.xml xml file.
The Second part which transcribes the content of the database in a web page.  – See below – We will call it the servlet[12] part.

Note: This outcome can be found at http://localhost:8080/example-camel-jpa/customers

Screenshot from 2014-12-15 13:37:35

 

 

 


First part of the Project (Content routing and transformation of information)

Here the idea is to unmarshall[11] or deserialize the content of the XML file through Camel Route (Here implemented in the JpaRouteBuilder.java) to an Entity Bean (here in Customer.java) which will then persisted to the H2 Database.

In the camel-jpa/src/java you have got : JpaRouteBuilder.java which is where the Camel route is going to be implemented.


/*
* #%L
* Wildfly Camel :: Example :: Camel JPA
* %%
* Copyright (C) 2013 - 2014 RedHat
* %%
* Licensed 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.
* #L%
*/
package org.wildfly.camel.examples.jpa;

import javax.ejb.Startup;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.transaction.UserTransaction;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
import org.apache.camel.component.jpa.JpaEndpoint;
import org.apache.camel.model.dataformat.JaxbDataFormat;
import org.springframework.transaction.jta.JtaTransactionManager;
import org.wildfly.camel.examples.jpa.model.Customer;

@Startup
@ApplicationScoped
@ContextName("jpa-cdi-context")
public class JpaRouteBuilder extends RouteBuilder {

@Inject
private EntityManager em;

@Inject
UserTransaction userTransaction;

@Override
public void configure() throws Exception {

// Configure our JaxbDataFormat to point at our 'model' package
JaxbDataFormat jaxbDataFormat = new JaxbDataFormat();
jaxbDataFormat.setContextPath(Customer.class.getPackage().getName());

EntityManagerFactory entityManagerFactory = em.getEntityManagerFactory();

// Configure a JtaTransactionManager by looking up the JBoss transaction manager from JNDI
JtaTransactionManager transactionManager = new JtaTransactionManager();
transactionManager.setUserTransaction(userTransaction);
transactionManager.afterPropertiesSet();

// Configure the JPA endpoint to use the correct EntityManagerFactory and JtaTransactionManager
JpaEndpoint jpaEndpoint = new JpaEndpoint();
jpaEndpoint.setCamelContext(getContext());
jpaEndpoint.setEntityType(Customer.class);
jpaEndpoint.setEntityManagerFactory(entityManagerFactory);
jpaEndpoint.setTransactionManager(transactionManager);

/*
* Simple route to consume customer record files from directory input/customers,
* unmarshall XML file content to a Customer entity and then use the JPA endpoint
* to persist the it to the 'ExampleDS' datasource (see standalone.camel.xml for datasource config).
*/
from("file://{{jboss.server.data.dir}}/customers")
.unmarshal(jaxbDataFormat)
.to(jpaEndpoint)
.to("log:input?showAll=true");
}
}

In addition to that, We will use JaxbDataFormat to point at our 'model' package in camel-jpa/src/main/java/org/wildfly/camel/examples/jpa/model/package-info.java


@javax.xml.bind.annotation.XmlSchema(namespace = "http://org/wildfly/camel/examples/jpa/model/Customer", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.wildfly.camel.examples.jpa.model;


 

Second part of the Project

In that part of that project,  the idea is to transcribes the content of the database in a web page through a Servlet[12].

In the camel-jpa/src/java you have got : CustomerRepository.java which is only there to send back customer information from the Database to the Servlet SimpleServlet.java


/*
 * #%L
 * Wildfly Camel :: Example :: Camel JPA
 * %%
 * Copyright (C) 2013 - 2014 RedHat
 * %%
 * Licensed 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.
 * #L%
 */
package org.wildfly.camel.examples.jpa;

import java.util.List;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;

import org.wildfly.camel.examples.jpa.model.Customer;

public class CustomerRepository {
    
    @Inject
    private EntityManager em;

    /**
     * Find all customer records
     *
     * @return A list of customers
     */
    public List<Customer> findAllCustomers() {

        CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
        CriteriaQuery<Customer> query = criteriaBuilder.createQuery(Customer.class);
        query.select(query.from(Customer.class));

        return em.createQuery(query).getResultList();
    }
}</pre>
<pre>

Entity Manager which is going to use details defined in your camel-jpa/src/main/resources/META-INF/persistence.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Wildfly Camel :: Example :: Camel JPA
%%
Copyright (C) 2013 - 2014 RedHat
%%
Licensed 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.
#L%
-->
<persistence version="2.0"
 xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="
 http://java.sun.com/xml/ns/persistence
 http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
 <persistence-unit name="camel">
 <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
 <class>org.wildfly.camel.examples.jpa.model.Customer</class>
 <properties>
 <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
 <property name="hibernate.show_sql" value="true"/>
 </properties>
 </persistence-unit>
</persistence>

Note : ExampleDS should be the default datasource set in your Wildfly instance. – see for instance your /wildfly-8.1.0.Final/standalone/configuration/standalone-camel.xml configuration file in your wildfly instance with the additional Camel Patches[1]

Finally here is the Servlet [12] implementation  : SimpleServlet.java:

/*
 * #%L
 * Wildfly Camel :: Example :: Camel JPA
 * %%
 * Copyright (C) 2013 - 2014 RedHat
 * %%
 * Licensed 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.
 * #L%
 */
package org.wildfly.camel.examples.jpa;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

import javax.inject.Inject;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.wildfly.camel.examples.jpa.model.Customer;

@SuppressWarnings("serial")
@WebServlet(name = "HttpServiceServlet", urlPatterns = { "/customers/*" }, loadOnStartup = 1)
public class SimpleServlet extends HttpServlet {

    static Path CUSTOMERS_PATH = new File(System.getProperty("jboss.server.data.dir")).toPath().resolve("customers");
    
    @Inject
    private CustomerRepository customerRepository;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);

        // Copy WEB-INF/customer.xml to the data dir
        ServletContext servletContext = config.getServletContext();
        try {
            InputStream input = servletContext.getResourceAsStream("/WEB-INF/customer.xml");
            Path xmlPath = CUSTOMERS_PATH.resolve("customer.xml");
            Files.copy(input, xmlPath);
        } catch (IOException ex) {
            throw new ServletException(ex);
        }
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /*
         * Simple servlet to retrieve all customers from the in memory database for
         * output and display on customers.jsp
         */

        List<Customer> customers = customerRepository.findAllCustomers();

        request.setAttribute("customers", customers);
        request.getRequestDispatcher("/WEB-INF/customers.jsp").forward(request, response);
    }
}

Object which will be called by the camel-jpa/src/main/webapp/WEB-INF/customers.jsp JSP file when you will access to the following URL  : http://localhost:8080/example-camel-jpa/customers

<%--
 #%L
 Wildfly Camel :: Example :: Camel JPA
 %%
 Copyright (C) 2013 - 2014 RedHat
 %%
 Licensed 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.
 #L%
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:forEach var="customer" items="${customers}">
 ${customer.firstName} ${customer.lastName}
</c:forEach>

Now up, you can compile you code using the following command at the root of your project /camel-jpa :


[fhornain@localhost camel-jpa]$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Wildfly Camel :: Example :: Camel JPA 2.0.0.CR1
[INFO] ------------------------------------------------------------------------
[INFO]
.......................
.......................
.......................
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.491s
[INFO] Finished at: Mon Dec 15 15:10:01 CET 2014
[INFO] Final Memory: 36M/333M
[INFO] ------------------------------------------------------------------------

and then deploy your code to your wildfly instance[1] with its additional camel patches.


[fhornain@localhost target]$ pwd
/camel-jpa/target
[fhornain@localhost target]$ cp -pR example-camel-jpa-2.0.0.CR1.war /wildfly-8.1.0.Final/standalone/deployments/

Then, you can play with the example.

You should have a customer directory in /wildfly-8.1.0.Final/standalone/data

Directory

 

 

 

 

 

 

Do a copy/paste of the the camel-jpa/src/main/webapp/WEB-INF/customer.xml xml file in that directory /wildfly-8.1.0.Final/standalone/data.


[fhornain@localhost WEB-INF]$ pwd

/camel-jpa/src/main/webapp/WEB-INF

[fhornain@localhost WEB-INF]$ cp -pR customer.xml /wildfly-8.1.0.Final/standalone/data/customers

You should now see an additional customer in the following web page : http://localhost:8080/example-camel-jpa/customers

New Web screenshot

N.B. if you are looking for certified and supported enterprise solutions please consider Red Hat JBoss EAP[8] or Red Hat JBoss Fuse[9]

Kind Regards

Frederic

[1] https://fhornain.wordpress.com/2014/12/14/wildfly-extras-wildfly-and-apache-camel/

[2] https://camel.apache.org/

[3] http://wildfly.org/

[4] http://www.h2database.com/html/main.html

[5] http://www.postgresql.org/

[6] http://www.mongodb.org/

[7] https://mariadb.org/

[8] https://github.com/wildfly-extras/wildfly-camel

[9] http://www.redhat.com/en/technologies/jboss-middleware/application-platform

[10] http://www.redhat.com/en/technologies/jboss-middleware/fuse

[11] http://en.wikipedia.org/wiki/Marshalling_%28computer_science%29

[12] http://en.wikipedia.org/wiki/Java_Servlet

 

 

 

 

 

 

 

 

 

 

 

Wildfly Camel

 

 

 

This quick tutorial  takes you through the first steps of getting Camel into WildFly[1][2] and provides the initial pointers to get up and running.

This explanation is based on the wildfly-camel Project[5].

First step is to download wilfly 8.1.0.Final at the following link : http://download.jboss.org/wildfly/8.1.0.Final/wildfly-8.1.0.Final.zip

Second step is to download the WildFly Camel Patch at the following link : https://repository.jboss.org/nexus/content/groups/public-jboss/org/wildfly/camel/wildfly-camel-patch/2.0.0.CR1/wildfly-camel-patch-2.0.0.CR1.tar.gz

Third step is to install the Camel Subsystem by applying  the patch into the wildfly 8.1.0.Final directory

[fhornain@localhost Project]$ ls
wildfly-8.1.0.Final  wildfly-8.1.0.Final.zip  wildfly-camel-patch-2.0.0.CR1.tar
[fhornain@localhost Project]$ cd wildfly-8.1.0.Final
[fhornain@localhost wildfly-8.1.0.Final]$ tar -xvf ../wildfly-camel-patch-2.0.0.CR1.tar

Then you have to create few users in order to have access to the wildfly administrator console and hawtio administration console/

[fhornain@localhost wildfly-8.1.0.Final]$ bin/add-user.sh 

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): a              

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : fhornainWildfly
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]:
About to add user 'fhornainWildfly' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'fhornainWildfly' to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'fhornainWildfly' to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/domain/configuration/mgmt-users.properties'
Added user 'fhornainWildfly' with groups  to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'fhornainWildfly' with groups  to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="XXXXXXXXXXXXXXXXXXX" /></pre>
<pre>[fhornain@localhost wildfly-8.1.0.Final]$
[fhornain@localhost wildfly-8.1.0.Final]$
[fhornain@localhost wildfly-8.1.0.Final]$ bin/add-user.sh 

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): b

Enter the details of the new user to add.
Using realm 'ApplicationRealm' as discovered from the existing property files.
Username : fhornainHawtio
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: admin
About to add user 'fhornainHawtio' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'fhornainHawtio' to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/standalone/configuration/application-users.properties'
Added user 'fhornainHawtio' to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/domain/configuration/application-users.properties'
Added user 'fhornainHawtio' with groups admin to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/standalone/configuration/application-roles.properties'
Added user 'fhornainHawtio' with groups admin to file '/home/fhornain/OttoProject/YttyProject2/wildfly-8.1.0.Final/domain/configuration/application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="XXXXXXXXXXXXXXXXXXX" /></code></pre>
<pre>

Finally, you can start your wildfly 8.1.0.Final java application server with the following command :

</pre>
<pre>[fhornain@localhost wildfly-8.1.0.Final]$ <code>bin/standalone.sh -c standalone-camel.xml</code></pre>
<pre>

Then you can log on the wildfly admin console via the following URL :  http://localhost:9990/console/App.html

Wildfly admin console

 

 

 

 

 

 

 

Or you can log on the hawtio[8] console via the following URL : http://127.0.0.1:8080/hawtio/login

Hawtio Console

 

 

 

 

 

 

 

Then you can see the sample camel route created by default for you through hawtio console :

Camel route diagram

 

 

 

 

 

 

 

Camel Route Source

 

 

 

 

 

 

 

FYI, this Camel XML route sample is located in your “standalone-camel.xml” configuration file you used to start your wildfly application server few minutes ago.

 <subsystem xmlns="urn:jboss:domain:camel:1.0">
 <camelContext id="system-context-1">
 <![CDATA[
 <route>
 <from uri="direct:start"/>
 <transform>
 <simple>Hello #{body}</simple>
 </transform>
 </route>
 ]]>
 </camelContext>
 </subsystem>

In conclusion, you are now ready to create camel route on top of wildfly[2].

N.B. if you are looking for certified and supported enterprise solutions please consider Red Hat JBoss EAP[6] or Red Hat JBoss Fuse[7]

Kind Regards

Frederic

[1] Based on the definition written on Wikipedia :

WildFly, formerly known as JBoss AS, or simply JBoss, is an application server authored by JBoss, now developed by Red Hat. WildFly is written in Java, and implements the Java Platform, Enterprise Edition (Java EE) specification. It runs on multiple platforms. http://en.wikipedia.org/wiki/WildFly

[2] http://wildfly.org/

[3] Based on the definition written on Wikipedia :

Apache Camel is a rule-based routing and mediation engine that provides a Java object-based implementation of the Enterprise Integration Patterns using an API (or declarative Java Domain Specific Language) to configure routing and mediation rules. The domain-specific language means that Apache Camel can support type-safe smart completion of routing rules in an integrated development environment using regular Java code without large amounts of XML configuration files, though XML configuration inside Spring is also supported. http://en.wikipedia.org/wiki/Apache_Camel

[4] https://camel.apache.org/

[5] https://github.com/wildfly-extras

[6] http://www.redhat.com/en/technologies/jboss-middleware/application-platform

[7] http://www.redhat.com/en/technologies/jboss-middleware/fuse

[8] http://hawt.io/

Openshift Workshop

 

 

 

 

 

 

Following my previous post named : [Open Source Cloud Day] Openshift | PaaS Sessions

Presentation can be downloded at http://www.slideshare.net/fhornain/openshift-enterprise-v2-workshop-december-2014

Kind Regards

Frederic

Open Shift Presentation

 

 

 

 

 

 

 

Following my previous post named : [Open Source Cloud Day] Openshift | PaaS Sessions

Presentation can be downloded at http://www.slideshare.net/fhornain/openshift-technical-usergroup9dec14kangaroot

Kind Regards

Frederic

 

FH_Redhat_Logo


The FeedHenry 3 Mobile Application Platform brings agility, visibility and efficiency to enterprise mobility — providing support for a range of toolkits and offering a suite of features that embrace collaborative app development across multiple teams and projects, with centralized control of security & backend integration, and a choice of cloud deployment options.

KR
Frederic

The Death of 2.0

November 7, 2014




“The speed with which strategy and business is changing now us fundamentally changing the way IT needs to and can deliver. I mean, I call it the death of version 2.0. Used to be IT would put in a system, relax for six months, catch their breath, and then start collecting a whole new set of requirements for a version 2.0—spend six months doing that, do planning, ultimately do coding, and three months after the first release is out come out with the second release.


Business doesn’t wait for that anymore. These fundamental large releases, whether it’s taking big, packaged applications and going through revisions or developing massive sets of functionality that are standalone and upgrade over multiyear time frames no longer works. What we’re seeing is successful IT organizations today really focus on rapid prototyping, get something up, get it running, and add to it. That’s what we’re seeing happening in Web 2.0 companies that have developed tremendous technologies like big data. We are seeing enterprise companies doing that by saying departmental pilot or let’s do a very specific thing with one set of customers or one specific function for our customers and then build out functionality from there because demands are changing much too quickly.”

Agree with that.

KR
Frederic