Assignment 2part 3 Asynchronou Middleware
Assignment 2part 3 Asynchronou Middleware
Assignment 2part 3 Asynchronou Middleware
1. Illustrate using diagram and briefly describe, How Queues are used in
TP-Monitors?
TP systems offer both queued and direct transaction processing. They offer
both client server and peer-to peer direct processing.
Gray & Reuter offer the following common taxonomy of process-to-process
communication:
Direct
Peer-To-Peer: either process can
initiate request. Responses are not
necessarily paired to requests.
Client-Server: client sends request to
server, server responds.
Queued
Client-Server: client sends request to
queue, server reads queue and places
response in output queue, client reads
output queue.
The shaded boxes in the figure represent a dispatcher that binds client
requests to servers. The dispatcher was traditionally called a TP-monitor.
Today dispatchers are called Object-Request Brokers (ORBs).
This tri-ACID unit model has the benefit of decoupling the client from the
server, but has the liability that it makes multi-request (conversational)
transactions impossible. Since each message exchange is three ACID units,
one cannot wrap a multi-step dialog in a single ACID transaction unit.
Implementing distributed transactions, conversational transactions, or multi-
step transactions on top of a queued system requires building a lot of
application-level machinery. IMS customers have invested millions of dollars
in such efforts.
The other aspect of reliable delivery is assuring that the broker does not lose
messages or delivery information before messages are actually delivered. In
general, messages remain in memory until they have been delivered or they
expire. However, if the broker should fail, these messages would be lost.
A producer client can specify that a message be persistent, and in this case,
the Message Router will pass the message to a Persistence Manager that
stores the message in a database or file system so that the message can be
recovered if the broker fails.
When persistent messages are enqueued, they are stored in database tables.
The performance characteristics of queue operations on persistent messages
are similar to underlying database operations. The code path of
an enqueue operation is comparable to SELECT and INSERT into a
multicolumn queue table with three index-organized tables. The code path of
a dequeue operation is comparable to a SELECT operation on the multi-
column table and a DELETE operation on the dequeue index-organized table.
In many scenarios, for example when Oracle Real Application Clusters
(RAC) is not used and there is adequate streams pool memory, the dequeue
operation is optimized and is comparable to a SELECT operation on a multi-
column table.
Persistent Messaging Basic Tuning Tips
Database table layout is similar to a layout with ordinary database tables and
indexes.
Memory Requirements
Streams pool size should be at least 20 MB for optimal multi-consumer
dequeue performance in a non-RACdatabase. Persistent queuing dequeue
operations use the streams pool to optimize performance, especially under
concurrency situations. This is, however, not a requirement and the code
automatically switches to a less optimal code path.
Using Storage Parameters
Storage parameters can be specified when creating a queue table using
the storage_clause parameter. Storage parameters are inherited by other IOTs
and tables created with the queue table. The tablespace of the queue table
should have sufficient space to accommodate data from all the objects
associated with the queue table. With retention specified, the history table as
well as the queue table can grow to be quite big.
Oracle recommends you use automatic segment-space management (ASSM).
Otherwise initrans, freelists and freelist groups must be tuned for AQ
performance under high concurrency.
Increasing PCTFREE will reduce the number of messages in a queue
table/IOT block. This will reduce block level contention when there is
concurrency.
Storage parameters specified at queue table creation are shared by the queue
table, IOTs and indexes. These may be individually altered by an online
redefinition using DBMS_REDEFINTION.
I/O Configuration
Because Database is very I/O intensive, you will usually need to tune I/O to
remove any bottlenecks.
6. briefly describe the advantages of queues in EAI
The approaches used for EAI have evolved from deploying Point-to-Point
solutions, to Message Broker architectures, and then to Process Broker
architectures (see fig. 1). This line of development clearly reveals the two
main forces driving it, namely:
1) complexity reduction, by moving from a Point-to-Point to a Message
Broker architecture, and 2) process logic extraction and encapsulation,
which is the essence is first in the queue and is therefore consumed, and
the process instance performs a transition to the state
Wait for Event 1. During the transition a message m3 is sent to human actor D
and a timer T1 is started.
Thereafter the message m9 is first in the queue. Since only message m5 can
initiate a further transition from Wait for Event 1, message m9 is discarded
(sent to the back of the queue). The next message in the queue is then m5,
which initiates Automated Business Decision 1 and the process instance
continues following the path satisfying the specified business rule.
7. What is message broker? Briefly, describe benefits and limitations of
message brokers?
Messages can be sent directly between two applications, but this requires the
two applications to know about each other when they are written; it also
means that both applications need to be online at the same time and producing
and consuming data at the same rate to communicate. This hard-wiring of
communication between applications does not scale as more and more
applications become interested in the information being shared.
A message broker provides a decoupling layer. By sending messages to a
third party - the message broker - a message-producing application no longer
has to know about all the applications that are interested in its information.
The message broker can provide queues that carry the messages to interested
message consuming applications. The message broker also provides a buffer
that allows the applications involved to produce and consume data at different
rates.
Message brokers can validate, store, route, and deliver messages to the
appropriate destinations. They serve as intermediaries between other
applications, allowing senders to issue messages without knowing where the
receivers are, whether or not they are active, or how many of them there are.
This facilitates decoupling of processes and services within systems.
8. What is SOAP?
SOAP is an acronym for Simple Object Access Protocol. It is an XML-based
messaging protocol for exchanging information among computers. SOAP is
an application of the XML specification.
Points to Note
Envelope is the core and essential element of every message, which begins
and concludes messages with its tags, enveloping it, hence the name.
Header (optional) determines the specifics, extra requirements for the
message, e.g. authentication.
Body includes the request or response.
Fault (optional) shows all data about any errors that could emerge throughout
the API request and response.
10. Briefly describe The SOAP Header
The optional Header element offers a flexible framework for specifying
additional application-level requirements. For example, the Header element
can be used to specify a digital signature for password-protected services.
Likewise, it can be used to specify an account number for pay-per-use SOAP
services.
Points to Note
Points to Note
Sub-elements of Fault
The SOAP Fault has the following sub elements –
1 <faultCode>
It is a text code used to indicate a class of errors. See the next Table for a listing
of predefined fault codes.
2 <faultString>
It is a text message explaining the error.
3 <faultActor>
It is a text string indicating who caused the fault. It is useful if the SOAP message
travels through several nodes in the SOAP message path, and the client needs to
know which node caused the error. A node that does not act as the ultimate
destination must include a faultActor element.
4 <detail>
It is an element used to carry application-specific error messages. The detail
element can contain child elements called detail entries.
1 SOAP-ENV:VersionMismatch
Found an invalid namespace for the SOAP Envelope element.
2 SOAP-ENV:MustUnderstand
An immediate child element of the Header element, with the mustUnderstand
attribute set to "1", was not understood.
3 SOAP-ENV:Client
The message was incorrectly formed or contained incorrect information.
4 SOAP-ENV:Server
There was a problem with the server, so the message could not proceed.
13. SOAP specifies in detail how messages must be processed, Briefly
describe.
The beginning of the 21st century is remembered for the internet boom.
Thousands of internet-driven companies were emerging and millions of users
were accessing the web every day. Now imagine that a single server starts
receiving thousands of requests from users (clients) simultaneously. And if
this resource does something more complex than show walls of text, things
can get slow. For instance, if users check the upcoming flights schedule and
must drill down to each flight detail, the server must be aware of what’s
happening with the client, right?
It appears that you can handle this situation in two ways: using stateful and
stateless operations. And SOAP supports both.
Stateful means that the server keeps the information that it receives from a
client across multiple requests. For instance, first it memorizes the flight dates
that you’re looking for and then provides information on the pricing after the
second request. This allows you to chain messages together, making the
server aware of the previous requests. Stateful messaging may be crucial in
operations involving multiple parties and complex transactions, e.g. bank
operations or flight booking. But still, it’s really heavy to a server.
Stateful operations is one of the reasons SOAP is used for bank transactions
and other data exchange that requires chaining messages. More on SOAP use
cases below.
14. Illustrate using Example and briefly describe how HTTP is used as a
communication protocol
As a request-response protocol, HTTP gives users a way to interact
with web resources such as HTML files by transmitting hypertext
messages between clients and servers. HTTP clients generally use
Transmission Control Protocol (TCP) connections to communicate
with servers.
15. Illustrate using Example and briefly describe how HTTP is used at the
server side
Proxies
Between the Web browser and the server, numerous computers and
machines relay the HTTP messages. Due to the layered structure of the
Web stack, most of these operate at the transport, network or physical
levels, becoming transparent at the HTTP layer and potentially making
a significant impact on performance. Those operating at the application
layers are generally called proxies. These can be transparent,
forwarding on the requests they receive without altering them in any
way, or non-transparent, in which case they will change the request in
some way before passing it along to the server. Proxies may perform
numerous functions:
caching (the cache can be public or private, like the browser cache)
filtering (like an antivirus scan or parental controls)
load balancing (to allow multiple servers to serve the different
requests)
authentication (to control access to different resources)
logging (allowing the storage of historical information)
16. Illustrate using Example and briefly describe how Parameter passing is
done using HTTP.