|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON Feature Mobile Auctions with 12snap
Mobile Auctions with 12snap
Jan. 7, 2002 12:00 AM
In October 1999 12snap's main goal was the development and commercial implementation of the world's first wireless shopping platform for existing mobile devices as well as WAP-enabled phones. The first application allowed mobile phone users across Germany to participate in auctions through a combination of voice, cell broadcast, and short messages, all based on the GSM technology so popular around the world (except in North America). This auction application went into production in February 2000 in Germany, the United Kingdom, and Italy. Additionally, there were other applications such as fixed-price shopping. In June 2001 a wireless betting application was added for the UK market. At the time of this writing, 12snap has removed the auction application from production until new market opportunities arise. However, we find the application interesting and will discuss it here.
How It Works The registration process is purposely very easy. The participants can either contact 12snap's call center to verbally provide all their information or they can go to the 12snap.com Web site and type in all of the required information. The important thing is that 12snap ends up with all the payment information to properly close the transaction. Auctions are announced via Cell Broadcast Services (CBS). The CBS message is received by any users, who activate the feature in their mobile phones. The activation allows configuration and reception of a certain number of channels. Each channel is identified by a three-digit identification and can be labeled. 12snap broadcasts on Channel 123, which is closer to omnicast than multicast. Every day the application sends several CBS messages to the mobile operator, who then distributes the messages to the cell broadcast-activated handsets. Each message announces the product to be auctioned on that day (see Figure 1), including a basic description of the product, the auction start price, and a phone number pointing to the voice response unit of 12snap (see Figure 2). As other users participate in the same auction, the system uses the Short Message Service (SMS) to inform previous participants in the auction with "bid topped" messages (see Figure 3). The SMS message carries enough information for the user to participate again and place a higher bid (see Figure 4). Once the auction is over, the application notifies the winner with a new SMS message (see Figure 5). When the winner is not a registered user, the SMS message also invites the user to register and provide payment information. In this case, the auction application waits for several hours for the unregistered winners to provide their information before proceeding with payment and fulfillment activities. If an unregistered winner does not provide the payment information within that period, he or she is blacklisted and prevented from participating on future auctions. At last count there were about 80 auctions a week running in Germany. These occurred between noon and 8:00 p.m. on weekdays and between noon and 10:00 p.m. on weekends. The average duration of an auction was about 15 minutes and one hour each day was dedicated to a specific type of product. Although the auction engine was designed to handle concurrent auctions for the various regions of Germany, this feature was never used.
Administration
Putting it all together, we have all of the components shown in Figure 6, where the participants supporting the process described earlier are:
The 12snap team had a major challenge in trying to design, develop, test, and implement the application in about four months, which is more or less equivalent to the infamous "yesterday" deadline that we are all too familiar with. Additionally, the application needed a cost-effective integration solution capable of supporting the connection needs to systems, such as voice response units, SMS gateways, and third-party payment services. Java, along with the Enterprise Java Beans specification, was quickly identified as the basic technology that would allow a quick development and implement a clean service-based solution. WebLogic was then selected as the application server platform mainly because it worked correctly on the first try. The design stage was divided into the following parts:
The initial aspects of the design addressed the auction logic itself. There are a variety of auction models that can be classified based on three phases: setup, bidding, and resolution. For example, in Dutch auctions the setup phase initiates a very high opening bid. During that phase the participants bid to lower the initial price. This will run until demand rises to match supply or the goods are exhausted. 12snap adopted a very simple auction model. In the setup phase the number of goods is defined. If there is more than one item, the winners will pay different prices. During the bidding phase the participants bid to increase the price. This process stops when no participant places a bid during a period called the extension time, which is defined in the setup phase. When there is only one item, the resolution phase assigns the item to the highest bidder. When there is more then one item (N > 1), they are assigned to the N topmost bids. In addition to the basic strategy, a number of states were defined for the auction, which indicate what methods need to be triggered. The actual transitions are timer-based and use WebLogic timer classes. Although these are WebLogic proprietary classes, there is no equivalent functionality present in the J2EE specification. The problem is that these timer classes are not cluster-aware, that is, a WebLogic timer is not aware of other timers running outside of its JVM. Since the application would run in a WebLogic cluster, this was going to be a show-stopper. The 12snap team had to perform some magic to allow the timer to work in a WL cluster configuration. This magic was based on three EJBs:
Functional Overview
Execution of an Event It then gets the next event to be executed, first checking that the event has not already been executed. To do so, it compares the date of this event with the next activation date stored in the AuctionTimerScheduler for when this event was scheduled (previous call to the schedule method). If these two dates match, then it can be executed. If not, another machine must already have executed this action, so the method just returns. By locking the row in the database, it prevents two instances of WebLogic from executing a sequence at exactly the same time. The transactions are handled by using a "user demarcated" transaction using JTS.
Scheduling on all the machines This was done by using multicast and a dedicated socket. There is a thread that listens on this socket for messages and executes the commands. On the other side, when you want to schedule or cancel a timer you simply send a message on this multicast socket and every member of the cluster will receive it. The TimerSchedulerMulticastThread listens for messages. The TimerSchedulerHelper contains utility methods to send these messages. The TimerSchedulerMgr bean, which is responsible for scheduling or cancelling timers, sends only the multicast messages.
Message format
Properties involved
This process is different from the basic scheduling because when it is executed the multicast socket may not be open. Basically, every machine registers the StartTimers startup class. But now, when you update and register the timer, you lock the row in the database with a "select for update" and a user-demarcated transaction. Then you update, that is, you remove the events that could not be executed, and you register the timer locally. To be able to schedule a timer locally or cluster-wide, some methods have been added to AuctionTimerMgr.
State Transitions In terms of modeling the auction engine, failures should receive special attention; they did not consider, for example, an "error" state for failures related to payment.
Software Architecture
Presentation Layer
Short Message Services The Short Message Service is a store and forward service. In other words, short messages are not sent directly from sender to recipient but through an SMS Center (SMSC) instead. Each mobile telephone network that supports SMS has one or more messaging centers to handle and manage the short messages. The Short Message Service features confirmation of message delivery. Unlike paging, users do not simply send a short message and trust that it gets delivered. Instead, the sender can receive a return message notifying them whether the short message has been delivered or not. Short messages can be sent and received simultaneously with GSM voice, data, and fax calls because whereas the other calls take over a dedicated radio channel for the duration of that call, short messages travel over and above the radio channel using the signaling path. As such, users of SMS rarely, if ever, get a busy or engaged signal. Sending and receiving SMS messages from an application requires a gateway solution that implements the native protocol supported by the SMS Center. On the application side, SMS gateways tend to offer standard access protocols such as SMTP, RMI, HTTP, or file access to interact with the mobile message infrastructure. Other formats are also available. Initially, 12snap decided to outsource the SMS gateway technology to one of the mobile operators in Germany and agreed on an SMTP interface. At the WebLogic level, they used JavaMail to prepare and send e-mail messages to the SMS gateway that corresponded to the SMS notifications the auction engine needed to send to the auction participants.
Cell Broadcast Services The implementation of the ASN.1 protocol was made using JavaCC and a reference CBE tool from the CBC manufacturer.
Interactive Voice Response An IVR has connections on one side to the telephony network (e.g. ISDN Q.931) and on the other side to the data network. Its DSP boards and software provide the necessary glue between both. When a call arrives at the IVR a script is immediately executed and two key pieces of information are given to that script: ANI and DNIS. ANI stands for Automatic Number Identification and represents the number of the person calling the IVR. The Dialed Number Identification Service (DNIS) carries the number called by the person. In essence, these numbers are equivalent to routing information that can be used by any script to make decisions. The scripts running on the IVR are commonly referred to as call-flows and link voice prompts together. It was decided, for performance reasons, to keep the actual sound files on the IVR itself. Call-flow decision points ask for a link to the middle layer for consistency across multiple channels. For example, when a caller dials into a specific auction, the IVR will need to contact the WebLogic server to find out if that auction is available or not. 12snap auctions began by hosting its equipment at an ISP that offered managed IVR solutions. In order to avoid technology dependencies it integrated the IVR with WebLogic through HTTP by implementing a basic thread-safe browser library on the IVR. For each line the IVR picks up, a browser thread was activated and used by the call-flow scripts to place HTTP requests against WebLogic. Servlets such as GetBid were implemented on the WebLogic cluster to pass information back to the call-flows.
The External Server This component supports modules, in this case Java objects that access native libraries. Accessing these libraries from the WebLogic JVM was considered too risky due to JNI-related issues, such as instability. The external server registers a Factory with WebLogic's JNDI tree so that they can access the modules from the application server. A "check" thread acts like a watchdog and verifies that the connection to the Weblogic server is still alive. If not, it re-registers itself into the JNDI tree. A console allows operators to administer the server via telnet.
Development Environment
Linux Workstations Setup Procedure
When it started the service, it identified a mobile operator capable of supporting it with hosting, IVR, SMS gateway, and call center capability. It was left to bring in its production hardware as shown in Table 4. Figure 8 shows how the components are laid out on the network segments.
JDK 1.3 and WebLogic 5.1 Migration
Day-to-Day
1. Product scouting (at the beginning of the month)
5. Auction planning 6. Auction scheduling 7. Last-minute changes (e.g. new products)
Common Scheduling Problems The second most common error was scheduling auctions which should start as soon as possible. The auctions were coupled to the Cell Broadcast channel and specifically to the property CBCDelay and the value "Preceding Time for Hourly Reminder." A large value here allows the broadcast to be sent early (which is better from the CB Center perspective), but this also means that once this time had passed it was too late to schedule a new auction for that hour. After scheduling an auction, all CB messages were sent to the CB Center immediately. In the case of an error a delete-message was sent. At this moment, CB is available only in Germany. It implemented an SMS-based subscription and notification module for use in Italy and UK.
Operational Information As we mentioned earlier, the system did not require the users to be registered to participate in an auction, so the potential users were actually higher than the number of registered users. All servers for all countries are hosted at an ISP in the UK. Each country has its own combination of WebLogic proxy and cluster servers. Database servers are shared for two of the three countries. The ISP provides connectivity to the 16 ISDN E-1 lines to service a total of 480 lines. There were about 80 auctions per week starting at noon and, interestingly enough, the peak times were at noon and at around 6 p.m.
Lessons Learned One of the first comments from its software engineers was, "We need code-beautifying, because code is partly not readable." This was an annoyance that was never resolved. It would be helpful to have some sort of beautifying tool for Java and specifically for J2EE. Within its code, exception handling suffered from poor design. 12snap limited its analysis to splitting exceptions into Recoverable and Unrecoverable from the user standpoint, e.g., wrong input: recoverable, database down: unrecoverable. This falls short when it comes to choosing which type is needed by the developer. 12snap now realizes it should have adopted nested exceptions based on a Runtime/Checked exceptions categorization. The output of exceptions should only be done in servlets or timer-triggered methods. The proper naming of variables was another area that caused trouble and 12snap concluded that it should always be carefully considered during code reviews. For example, at some point 12snap had the following "pathological" variable names:
Writing the file could fail for several good reasons (e.g., disk full), and information would not pass to the ERP system although the application would flag it as complete. In retrospect, this is something that 12snap reckons it should have implemented using an asynchronous mechanism, such as the Java Message Service. This way there can be some level of guarantee that the transactions will arrive correctly in the ERP system. From Navision's side, a dedicated client runs the Navision data ports, which are timer-controlled scripts that would fetch or deposit files to/from Navision.
Conclusion As you can see, nothing magical happened in order to have a stable application running. Just a lot of common sense and a few mistakes that we hope everyone can learn from. BEA WEBLOGIC LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||