GithubHelp home page GithubHelp logo

blogs's People

Contributors

aknguyen7 avatar austin0 avatar awisniew90 avatar brutif avatar charlotte-holt avatar danielguinan1 avatar dearrudam avatar dmuelle avatar ellenwyllie avatar emily-jiang avatar ericglau avatar gkwan-ibm avatar gracejansen avatar jakub-pomykala avatar jgawor avatar kathrynkodama avatar kevin-ortega avatar kinueng avatar lauracowen avatar mbroz2 avatar nottycode avatar ocseal avatar ruilin-ma avatar ryan-storey avatar steven1046 avatar tjwatson avatar tomjenningss avatar una-tapa avatar yasmin-aumeeruddy avatar yeekangc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

blogs's Issues

Blog posts on Space Sentry

Write about Space Sentry, the story/journey there, and how one can replicate and build their own as well as to contribute.

Open API Tools with MP Rest Client support

Blog about what we have contributed to generate template interfaces for MP Rest Client. This is targeted for 4.2.3 of Open API Tools. Can align post with that.

Also, cover its corresponding VS Code extension if possible too.

@ericglau

Create Prometheus alert manager

Learn how to configure the Prometheus Alertmanager for Open Liberty and MicroProfile Metrics to send alerts via Slack. Alerts help quickly and automatically detect problems for better monitoring and maintenance of your application.

Automatically compress http responses

Things we need to ensure we include in the blog:

Document order relative to other similar servlet body filters
Document configuration error conditions, how to verify configuration
is as expected(types are what is expected for example). There are also multiple examples in the design document.

Move BYO Jackson article from WASDev to OL Blogs

OpenLiberty supports JAX-RS 2.0 and many users run into problems with JSON serialization - and the solution is for them to package Jackson with their app. I wrote this article for WASDev.net a few years ago to address this issue for WebSphere Liberty users, but it is equally applicable to OpenLiberty users, so I think it should be ported over to the OL site.

Here is the link to the original article:
https://developer.ibm.com/wasdev/docs/jax-rs-websphere-liberty-byo-jackson/

Managing global (XA) transactions on AWS with Websphere Liberty


From WASdev.net

By Jamie Coleman and Neil G Young

A transaction is an atomic unit of work in which multiple updates (e.g. to a database) must be completed within the transaction or, if there are problems, none of the updates are made at all (also known as two-phase commit). The purpose of transactions is to avoid situations where only part of an update is made. This article demonstrates a WebSphere Liberty application that processes global (XA) transactions across multiple resources and how Liberty automatically recovers the XA transaction during a simulated server failure in a cloud environment.

A common example of a transaction is when multiple SQL updates to a relational database are committed atomically by the database during the processing of an SQL COMMIT statement. In this case, the transaction is local to a single resource, the database manager, and is entirely controlled by it.

If an application accesses multiple resource managers, such as database or message queue managers, an external transaction manager is required to coordinate the updates across the resource managers to ensure an atomic outcome (i.e. all the updates are made to all the resources, or none are made at all). WebSphere Liberty contains a transaction manager which can manage such global, or XA, transactions.

In the absence of a transaction manager, a system failure can lead to inconsistent data in the resources. The transaction manager in a Liberty server processes transaction through a two-phase commit protocol. The Liberty transaction manager ensures that all participants in the XA transaction either commit or roll-back their changes. The protocol is designed to be robust in the face of many kinds of system failure. To enable recovery from failure, all the participants in an XA transaction each write their own persistent log records.

If a system failure is encountered, it is possible for an XA transaction to be left in-doubt, where not all participants have confirmed that they have committed or rolled-back their activities. In such situations, resources are locked in the corresponding databases or message queues, and other applications are unable to access those resources. In most cases, Liberty is able to automatically recover these resources by resolving in-doubt XA transactions on a server restart.

Before starting this tutorial, note that the callback code that we use to halt the server is not supported by IBM. It might change without notice and is not designed for production use. We've simply provided it for this tutorial to demonstrate XA transaction recovery. So don't use it for real!

Setting up the cloud environment

We've tested this tutorial on Ubuntu 14.04 running on Amazon's EC2 infrastructure but it should also work for other OSes and cloud providers.

To set up your environment:

  1. Get an Amazon Web Services (AWS) account.
  2. Set up an AWS EC2 instance with Ubuntu 14.04.
  3. Set up SSH access to your EC2 instance.
  4. Run apt-get update in your EC2 instance.
  5. Run apt-get install unzip to install unzip into your EC2 instance.
  6. Run apt-get install git to install Git on your EC2 instance.
  7. Run apt-get install default-jre to install a JRE.
  8. Download WebSphere Liberty (we used Web Profile 7).
  9. Install Liberty on your EC2 instance by extracting the ZIP file to a directory on the EC2 instance, such as /opt/ibm.

Preparing the Web application for testing

If you prefer to use a built version of the test application and the hook that allows you to terminate the server before a transaction completes, you can download it from the GitHub Releases page then skip to the next section.

To clone the git repository and build the application yourself:

  1. Clone the AWS sample git repository to your local machine or EC2 instance.
  2. In the cloned repository, change to wlp/transactionRecovery/webapp directory and build the application with the command:
    mvn clean install
  3. Change to the wlp/transactionRecovery/callback directory and repeat the command to build the callback hook code that we'll use for stopping the server mid-transaction:
    mvn clean install

Deploying the application

To deploy the application to the Liberty server and configure the server:

  1. When you've installed Liberty, start the Liberty server by changing to the bin directory of your Liberty installation and running the command:
    sudo ./server start --clean

    This automatically creates a default server in the wlp/usr/servers/defaultServer directory of your Liberty installation.


  2. Copy the application WAR file into wlp/usr/servers/defaultServer/dropins.

  3. Now stop the server using the command:

    sudo ./server stop
  4. <li>Copy the callback code JAR file that you built earlier (<code>com.ibm.ws.Transaction.test.impl.XAFlowCallbackImpl_1.0.jar</code>) into the <code>lib</code> directory of your Liberty installation.</li>
    <li>Replace the <code>server.xml</code> file in <code>wlp/usr/servers/defaultServer</code> with a copy of the <code>server.xml</code> file from the <code>transactionRecovery</code> directory in the clone of the Git repository.</li>
    <li>Create a file in the <code>wlp/usr/servers/defaultserver</code> directory called <code>jvm.options</code>. Add the following line to the <code>jvm.options</code> file:
    
    -Dcom.ibm.ws.Transaction.fvt=true

    The jvm.options file calls the code that will halt the server just before your transaction is committed. Alternatively, to see the application complete a transaction successfully, remove the jvm.options file.

  5. Copy the xaflow-1.0.mf file located in transactionRecovery/webapp in the cloned Git repository to the wlp/lib/features directory of your Liberty installation.

Starting the test

To run the test:

  1. Start the Liberty server. To check that the server started correctly, see the console.log or messages.log files in wlp/usr/servers/defaultserver/logs. Your server is running if you see the message “the server is ready to run a smarter planet*”.
  2. Find the public IP address of your EC2 instance, which is on the AWS EC2 web page for your instance:
    <a href="https://developer.ibm.com/wasdev/wp-content/uploads/sites/9/2016/09/AWS-EC2-blanked-arrow.png"><img src="https://developer.ibm.com/wasdev/wp-content/uploads/sites/9/2016/09/AWS-EC2-blanked-arrow.png" alt="AWS EC2 blanked arrow" width="1899" height="1047" class="alignnone size-full wp-image-19022" /></a></li>
    <li>Visit the application web page in your browser. The web page URL is constructed from the public IP address, followed by the Liberty server’s HTTP port number (9080) and the application name (e.g. xaflow), followed by the method we will be calling. For example: <code>xxx.xxx.x.xxx:9080/xaflow/xaflow?test=setupRecXAFlow001</code>.
    

    The web page should load for a couple of seconds then display a message saying something like page cannot be displayed. This is because when you ran the application, it created two databases with tables, created a two-phase commit XA transaction for the two databases, and then crashed the server before it could finish. Don’t worry! This is exactly what we wanted to test.


  3. At this point, check the database to see if it has been locked by Liberty (we're using Liberty's embedded Derby database). Change to the wlp/usr/shared/resources/data directory, then start the Derby interactive command line interface:

    ij
  4. <li>On the ij command line, run the following commands to try connect to the database and view a table which should not be possible at the moment:
    
    connect 'jdbc:derby:exampleDB';
    select * from NEIL_DERBY;

    The commands should should display a null pointer exception because Liberty has locked the database while the XA Transaction is in-doubt.

    <li>Before we can restart the server, we need to make a configuration change. The <code>jvm.options</code> file you created earlier is the reason the server crashed so you need to rename this file so that it does not halt the server on restart. From the <code>defaultServer</code> directory, rename the file:
    
    mv jvm.option jvm.optionsOld
    <li>Start the server.</li>
    <li>Check the <code>messages.log</code> file. You should see that the server has started, the transaction has now been successfully recovered and you are ready to create a smarter planet.</li>
    
  5. To double-check that all this worked, stop the Liberty server and use ij to connect to the database to view the table information and data again. The XA transaction has been rolled-back and the lock on the databased removed.

Congratulations! You have successfully deployed WebSphere Liberty into Amazon Web Services, deployed an application, created a transaction and two databases, crashed the server mid-transaction, and then recovered that transaction. In a future article, we'll look at how to achieve the same thing but over distributed data centers in different locations.

Let us know what you think!

Build Warning from 2018-12-20-http-forwarded-header.adoc

There is a build warning when rendering the blog post file 2018-12-20-http-forwarded-header.adoc. The warning does not impact the refreshing of openliberty.io.

asciidoctor: WARNING: 2018-12-20-http-forwarded-header.adoc: line 51: section title out of sequence: expected level 2, got level 3

Blog post on MP GraphQL 1.0

MP GraphQL 1.0 (Epic OpenLiberty/open-liberty#7956 ) is targeted to ship with Open Liberty 20.0.0.6. I'd like to include a blog post describing how users could build GraphQL applications and take advantage of Open Liberty value-add features like integration with application security for authorization checks, etc.

Laura: Aim to publish on Wed following the release (10th June)

Refine instructions on how to contribute blog posts

Right now the instructions are in a rough state, but are enough to get someone going with blog development.

  1. Update OpenLiberty/openliberty.io README to point to this repository to find blog authoring instructions.
  2. Update the Dockerfile's comments to reflect how to use the docker image. File here https://github.com/OpenLiberty/openliberty.io/blob/master/Dockerfile
  3. Decide if we want people to build the docker image or pull from dockerhub (at the moment hosted on kinueng/openliberty.io)
  4. Add maybe some instructions about using the staging site (openlibertydev) after using the docker image.
  5. Evaluate who must review pull requests to this repository

FYI @lauracowen

Blog post on Scala apps on Open Liberty

An example application to calculate a Mandelbrot Set using Microprofile/Open Liberty microservices implemented in Scala. The goal is to demonstrate technical possibility of using Open Liberty with Scala and possibility of deploying such solution as Kubernetes services.

Submitted/authored by @krzsam (from discussion with @Emily-Jiang )

Java Batch

@follis I'm just tidying up the backlog so I can see what we have outstanding (sorry for the delay in responding to the PR attached to this). Then I'm going back over the list to review/edit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.