2002), traditional monolithic MOM implementations
are not enough. Messaging features must be adapted
in order to deal with restrictions imposed by mobile
devices and wireless networks. Thus, the proposed
middleware adopts the following adaptations.
Sending Buffer. Taking into account the frequent
disconnections of mobile networks, this mechanism
temporarily stores messages in a local buffer while
waiting to be transmitted when connection is again
available. Such mechanism enables the sender
application to ‘fire-and-forget’ messages, trusting
the middleware to handle the delivery.
Message Time-to-Live (TTL). Despite local buffers
being an efficient way of dealing with
disconnections, long disconnection periods can
overload the device memory, which is usually very
constrained. Thus, applications must specify a
message time-to-live (TTL), which defines the time
that a message can be kept by the middleware while
waiting to be transmitted.
Persistent Messages. Although the sending buffer
provides an exactly-once delivery guarantee, in
cases of abnormal conditions, such as resource-
exhaustion, processing failure or device being turned
off due to low battery, messages managed by a
device may be lost. The proposed middleware
mitigates such an issue by allowing messages to be
marked as persistent and thus to be stored in a non-
volatile memory.
Service Location. Traditional MOM providers, such
as (Sun Microsystems, 2002), use a fixed,
predefined lookup service in order to transparently
find available services. However, in mobile
networks, it cannot always be assumed the existence
of a central entity to lookup services from. Due to
that, the proposed middleware advertise its services
in the network by means of a service discovery
protocol, similar to (Rellermeyer, 2010). In order to
look up services, the middleware sends a multicast
message to the network. Devices providing services
listen to that multicast address and reply in unicast
indicating their service addresses.
2.3 Messaging Styles
The messaging features presented in the previous
section consist in common facilities for dealing with
issues in mobility scenarios. Such features form the
basis for providing messaging exchanges in a variety
of message-based communication paradigms. In
order to provide multiple communication paradigms,
only the code specifically related to message
delivery semantics must be added. This subsection
specifies the communication paradigms considered
in this proposal and discusses design decisions.
Message Queue Paradigm. Message queuing is
based on the adoption of distributed queues, where
several producers send messages to a queue and then
various consumers retrieve them from the queue. In
contrast to traditional MOM platforms, in which
queues are created only by the system administrator,
queues in the proposed middleware are created
dynamically and on demand by applications.
By following the peer-to-peer style, message queues
can be hosted in any device of the network and
applications can access local or remote queues.
Additionally, the time interval that messages are
held is queues is also controlled in order to avoid
resource exhaustion. Traditional enterprise message
queue systems usually store messages indefinitely.
However, mobile devices have storage resources
very limited. Therefore, the message TTL defines
how long a message can spend in a queue until being
read or, otherwise, discarded.
Tuple Space Paradigm. The notion of tuple space
was originally proposed in Linda (Gelernter, 1985)
as a coordination language for concurrent
programming, however, its uncoupled and
opportunistic style of communication has been
shown to provide many useful facilities for
communication in mobile environments. Tuple
spaces provide a simple and powerful abstraction for
accessing a shared memory, which acts as a
repository of data structures for distributed
applications communicating by means of the
insertion and removal of tuples.
Each tuple has a set of application defined properties
which are used in retrieval operations and can
differentiate each one from the others. The retrieval
of tuples is by means of content association, that is,
by comparing a set of properties informed as
parameter and the properties of the tuples in the
space. A tuple space service can be created in any
device and serve as a mean to allow distributed
applications to communicate. Furthermore, similar
to message queues, tuple spaces services are created
on demand, by applications.
Publish/Subscribe Paradigm. In this paradigm,
communication is achieved by publishing events and
subscribing in certain types of events. An
intermediate service, called event channel, records
subscriptions and forwards events produced by
publishers for all interested subscribers. Each event
channel is identified by a topic service name, which
specifies a group of similar applications exchanging
messages.
ICSOFT 2010 - 5th International Conference on Software and Data Technologies
160