Welcome!

Java IoT Authors: Stackify Blog, APM Blog, Liz McMillan, Elizabeth White, Yeshim Deniz

Related Topics: Java IoT

Java IoT: Article

Look Mom, No Application Servers, Look...MOM!

'What do you think of application servers?' The most popular answer was, 'I don't need no stinkin' application server.'

In the unlikely event that you're not familiar with my gas station, you can find my previous essays at http://java.sys-con.com/general/gasstation.htm Recently, I've conducted a small survey among my truck drivers. I asked them just one question: "What do you think of application servers?" The most popular answer was, "I don't need no stinkin' application server." And truck drivers usually know what they're talking about!

You may think that now I'll start selling one of the popular application frameworks. Wrong! The idea of these frameworks was nice: get back from complex containers to programming POJOs. But while trying to provide alternatives to container services, each of these frameworks ran into the short-blanket syndrome: something is always sticking out. XML is sticking out big time!

To simplify Java programming, developers are paying the high price of adding unmanageable amounts of XML descriptors, mappings, wirings, and other plumbing. Twenty years ago .ini files were widely used, 10 years ago .properties replaced them, and after the Y2K problem was solved, people were bored and started investing their time in XML.

It started quite innocently: XML is better than HTML, then DTD came about, XSLT, XPATH, XQuery, XML farms, XML processing hardware, and on, and on, and on. Basically, the proper way to name today's POJO is XPOJO. You know what I mean. Hopefully, Java annotations will slow down the X-hype. I'm already using Java 5 in my agile business, and as soon as Mustang is released, big corporations will switch to Tiger.

Let's return to the main subject. One of my readers asked if I was planning to write a piece on how to select an application server. I answered, "No, because I'm not sure if they're needed."

I believe that at least a half of today's business applications don't need one. In my gas station, I'm going to implement a set of client/server applications with rich clients talking to each other using Java messaging, and most likely, I'll need to implement an Enterprise Service Bus (ESB) to communicate with a couple of old applications that I inherited from the former owner of my gas station.

My newly developed applications will use rich application clients living in a Web browser, but they'll run in their own virtual machines (no AJAX by the pumps!). I've already started working on a more serious manuscript on RIA (see http://theriabook.com). To make a long story short, I'm planning to use/implement SOA, RIA, MXML , JWS, JMS, MOM, JNDI, ESB, JTA, DAO, JDBC, DBMS, and a Web Server. Raise your hand if you know how to spell out each of the acronyms used in this article so far.

I know, I know. Ten years ago, people who could spell out VB and SQL were able to find a nice paying job in a heartbeat. Forget about it. I can recommend a handy Web site called acronymfinder.com. In some cases it gives you too many versions for your acronym, but key in JTA and you'll find that it stands for Java Transaction API (it's right above Japan Toilet Association). Since I'm not going to use the J2EE application server, I have to find transaction support somewhere else.

Consider the use case of a typical business application without an application server. The front-end reacts to various events by putting messages (Java value objects or key-value pairs) into a remote message queue (orders, requests, etc.). A server-side JMS listener picks them up from the queue and starts business processing the messages received. This is where transaction support comes in handy. For example, from a business perspective saving a customer's order in a database and making a JMS call for further processing can be considered one unit of work, which has to be rolled back if any of these actions fails. That's why a JMS listener has to be able to begin, commit, and roll back transactions.

Communicating with the database can be done using a simple DAO/JDBC combo. Create a tiny .properties file with a dozen parameters (the data source to use, maybe some external URLs, and a couple of others). That's it. This is what I call real POJO programming. Did I miss anything? Oh yeah, JMS is just an API, so we need a transport/storage for our messages, and this is what Message-Oriented Middleware (MOM) is for.

While there are several Open Source JMS/MOM implementations on the market, I'm planning to use ActiveMQ from Logic Blaze. The product has been on the market for years, has good reputation, supports JTA/XA, and has a large user community. Look at the ActiveMQ list of features, and you'll see that it offers more than any small business needs. Another pro is that the same vendor offers an Open Source JBI-based ESB implementation called ServiceMix. But this is a topic for future discussions. And the best part is that this middleware is available for free.

Not everyone may like this architecture, but let me remind you, we're talking about a small business here. One of my readers sent me an e-mail asking, "What if this application is supposed to be used by thousands users?" I wish... This is just a gas station! When you're architecting your next application, try not to get into a Google/Amazon state of mind unless you work for them. If you're not dealing with thousands of users, just use a simple Data Access Object, write a couple of SQL statements here and there, and make a dozen JDBC and JMS calls. And MOM will be a good, reliable foundation for creating loosely coupled applications with robust transactions, persistence, and failover support.

More Stories By Yakov Fain

Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain

Comments (11) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
RogerV 04/18/06 02:13:38 AM EDT

Hi Greg. In my case I design distributed apps using JMS for marine terminal operations and all my nodes run on the same network. Hence my JMS clients don't have to go thru a firewall to interact with the JMS server.

However, a typical JMS server can be started up to accept connections on an arbitrary port so you could accept unencrypted connections on port 80 and SSL connections on port 443. As long as your firewall doesn't enforce strict HTTP protocol over port 80 then you should be fine.

My company uses Tibco EMS which is a proprietary JMS that has excellent .NET client that is 100% managed code. They also support .NET Compact Framework on WinCE, which we happen to use on embedded industrial microcomputers.

I've seen info that ActiveMQ supports .NET clients now so you might look at that for an open source implementation.

If you need enterprise capabilities, you'll certainly find it in the Tibco product, though.

As to payload, we pretty much stick to XML, which is easy to process in both .NET and Java in various ways. Sometimes I use XML object serialization and sometimes I just use XPath. I stick with JMS properties that are string values as that works well with any client language bindings.

You can check out some more of my writings on JMS related matters here:

http://vossnet.org/jms-links.html

Greg 04/17/06 01:02:55 PM EDT

Hi RogerV,
We're doing something similar in terms of .NET client talking to a JEE server. Currently we're using a more custom protocol for having the .NET client talk to the server, but we'd like to move to JMS. One thing that I'm worried about is firewall issues. I'd love to hear your thoughts about JMS implementations, etc. that bridge that gap, and any lessons learned about having .NET and JEE interoperate in that way.

Yakov Fain 04/16/06 08:26:24 AM EDT

Roger,

In this article I do not ask to abandon app servers. But I do believe that half of the applictions do not need them. I don't buy your arguments about JBoss saving your messages and moving the bad ones into a dead letter queue: this functionality is supported by any MOM server.
As to other advantages of the app servers that you've mentioned, I'll just remind you that we are talking about gas station here. I guess, I can survive without clustering and HA support.
What I do need though, is a new AC unit. It's getting hot in the summer in my convenience store :))

RogerV 04/15/06 12:50:51 PM EDT

Hi Yakov.

As we've chatted on this subject before on other forums, you know that I'm a big fan of JMS and asynchronous messaging in general. I'm the guy that does rich clients using .NET Winforms and then JMS as my distributed computing communication protocol. So I'm in lock step with your sentiments on both of those choices: messaging and rich clients (as opposed web browser thin client).

However, I don't agree much with your sentiment to abandon application servers. For the series of distributed applications I've created over the last 3 1/2 years using this messaging paradigm, I've found my JBoss application server to be an extremely crucial component in the overall mix.

IMO, The EJB 2.0/2.1 spec of the Message Driven Bean (MDB) is the most successful and useful EJB that was defined for JEE. They are very simple to program and yet can avail themselves of all JEE services. I can easily achieve the objectives you mention of processing an in-coming message while in turn interacting with the database (and in my case it is also frequently an interaction with a distributed cache). All these interactions can be done under an XA transaction by simply specifying a declaration in the deployment descriptor of the MDB. Very simple indeed.

When an XA roll-back occurs, the msg. remains safely in the queue. JBoss can be configured to retry it multiple times. After exhausting retries, JBoss moves the msg. to a dead letter queue - where can be configured to raise administrative alert. Sometimes when our back-end database gets really bogged down, some transaction might fail and get rolled back. Yet on some successive retry, the operation will finally pop on through. It's nice to have this bit of resiliency as this system.

Another group in my company chose to use JMS messaging but also decided to code everything in .NET - their choice is essentially equivalent to the one you say your making in your article. So they have no nice application server to host things in. Therefore they are always reinventing these various wheels that I, in contrast, just take for granted by choosing to use a JEE application server. Database connection pooling (with automatic reconnect mgt.), declarative XA, JNDI to lookup other services to consume, application hot deployment (this is a biggie), clustering and high availability (another biggie), distributed caching, - I could go on and on listing the things I use daily but those guys have to code themselves or else do without.

I really struggle to try and understand why it is people do such things to themselves. Their excuse is that they simplify by having C# .NET as their universal programming language at all end-points. But by tossing aside Java in the middle-tier they have lost a great deal indeed as .NET provides them practically nothing other than database access APIs.

Frankly I just don't get what people are talking about in terms of JEE complexity (the issue you allude to). I use JMX MBeans, JMS MDBs, and Hibernate persistence (I've purposely avoided session beans and entity beans). In my view, and from 20 years experience, server-side programming doesn't get any easier than this combo. It's truly an embarrassment of riches to be a JEE developer in such a context.

Yakov Fain 04/15/06 11:27:47 AM EDT

Ron,

I have no intention to create my own app server. All the components mentioned in the article are open source tools available on the market. My POJOs will contain the business logic only

Ron Smith 04/15/06 10:40:20 AM EDT

I completely agree with your feelings about XML Hell. I keep saying "I thought I was a Java programmer, not an XML programmer".

Still, what you are basically saying is, "write your own app server". I'll admit it's nice that most of the pieces of an app server have been decoupled to the point that you can mix and match. Unfortunately, I have been the one that comes in behind a project like this and I had to figure out how frankenstein pieced his monster together. Sometimes, the users requirements change (the gas station decided it needed to sell sushi -- its a local joke in Memphis, don't ask) or the app needs to scale (gas stations do sometimes turn into oil companies, it seems) or who knows what.

Maybe roll-your-own is a first step towards a better standard. Personally, I am more and more disappointed in the directions that Java is going and I'm not sure I want to stay on for the ride.

Nambi Sankaran 04/15/06 01:40:48 AM EDT

Hi Yakov

Using MOM (JMS) with POJOs, and plain XML for data transfer, is perhaps the best way to build an application.

Using this approach I am able to build a trading platform. Presentation of data to the user is done by creating javascript widgets in a browser.

Our home page is http://opentrade.sourceforge.net.

Though this is not a gas station, I am sure this application can be scaled to the demands of larger volume websites such as amazon.

Yakov Fain 04/14/06 09:20:14 PM EDT

Most likely, Jencks (http://jencks.org/)

Greg 04/14/06 07:12:55 PM EDT

What JTA implementation are you planning on using?

SYS-CON Brazil News Desk 04/13/06 10:44:08 AM EDT

In the unlikely event that you're not familiar with my gas station, you can find my previous essays at http://jdj.sys-con.com/read/category/1142.htm. Recently, I've conducted a small survey among my truck drivers. I asked them just one question: 'What do you think of application servers?' The most popular answer was, 'I don't need no stinkin' application server.' And truck drivers usually know what they're talking about!

SYS-CON India News Desk 04/13/06 10:18:44 AM EDT

In the unlikely event that you're not familiar with my gas station, you can find my previous essays at http://jdj.sys-con.com/read/category/1142.htm. Recently, I've conducted a small survey among my truck drivers. I asked them just one question: 'What do you think of application servers?' The most popular answer was, 'I don't need no stinkin' application server.' And truck drivers usually know what they're talking about!

@ThingsExpo Stories
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...