Thursday, September 10, 2020

Short SOA Notes



What is SOA?
SOA is an architecture which allows or which gives a solution to integrate 2 or more system.

It is an architectural style of building business applications using loosely couple service acts as black box (Independent) and these can be orchestrated together to achieve business functionality.

Orchestration?

The process of combining discrete set of service into single unit is called as orchestration.

Namespace
Whenever we have two or more elements with same name but different context then we use concept of namespace to avoid the ambiguity.
xmlns ="" (it can be any string but std is we use url bcz its always unique)

target namespace
-> It is convention of xml doc which allows its elements to be referred in future
-> when we want to refer current xml document element.

default namespace
Any namespace without prefix is called as default namespace.
we can have at max 1 and 0 default namespace.
prefix is alias to namespace. 

WSDL
Abstract is used at the time of development, it just have information about operation and message type. 
Concrete / complete wsdl - which has information about service location as well as binding and transport info 

XPATH is used to navigate within xml doc .

XSLT:  is used to convert one format of  xml to another .

1.
 “Client” policy When we call secured web service from SOA 
“Service” policy when we want to secure our web service 

2.
Fault-binding.xml composite, component or reference details
fault-policy.xml fault policeis,actions,conditions

3.
fault policies will only be executed when an invoke activity fails.

4.
ora-human-intervention instance state is set to “Running”.
ora-rethrow-fault instance state is set to “Faulted”

5.
Remote Fault connectivity issue while connecting to reference systems/applications.
Binding fault invocation fails 
                    A binding Fault is not retry-able, fixed by human intervention.

6. singleton property 
-> In the clustered environment when the processing of the message should happen via only one SOA managed server, then the property singleton needs to be defined at the adapter level.
<binding.jca config="bindin_file.jca">
        <property name="singleton">true</property>
</binding.jca>

7. persistent store
-> A persistent store is a physical repository for storing subsystem data.
-> it can store persistent JMS messages or temporarily store messages 
-> The persistent store supports persistence to a file-based store or to a JDBC-enabled database.

8. BPEL Persistence Properties
BPEL Persistence properties are used to control, when a process need to dehydrate. 

9. InMemoryOptimization
This property indicates to Oracle BPEL Server that this process is a transient process (synchronous) and dehydration of the instance is not required. 
TRUE Oracle BPEL Process Manager keeps instances in memory only.
false (default) instances are persisted completely and recorded in the dehydration store database for a synchronous BPEL process.

10. CompletionPersistPolicy
This property is only used when inMemoryOptimization is set to true.
on (default): The completed instance is saved normally.
deferred: The completed instance is saved, but with a different thread and in another transaction, If a server fails, some instances may not be saved.
faulted: Only the faulted instances are saved.
off: No instances of this process are saved.

<component name="mybpelproc">
...
<property name="bpel.config.completionPersistPolicy">faulted</property>
<property name="bpel.config.inMemoryOptimization">true</property>
...
</component>

11.OneWayDeliveryPolicy
 Its used when we need to have a sync-type call based on a one way operation. 
This is mainly used when we need to make an adapter synchronous to the BPEL Process.
By default, incoming requests are saved in the following delivery service database tables: dlv_message

<component name="UnitOfOrderConsumerBPELProcess">
...
<property name="bpel.config.transaction" >required</property>
<property name="bpel.config.oneWayDeliveryPolicy">sync</property>
...
</component>

If BPEL Process is Async or one-way process then, Delivery policy  attribute can have three values.
 async.persist: Messages are persisted in the database hash map.
 sync.cache: Messages are stored in memory.
 sync: Direct invocation occurs on the same thread.

Using the sync option offers the best performance, but the requester will perceive that it took longer to post the  message due to the increased coupling between the requester and the target. 

Similarly, using the async.cache option reduces the performance overhead of storing the message in memory. 
However, if the server fails before the message is processed, it will be lost as it is stored in memory.
A One-way invocation
offers several advantages in terms of scalability,  because the service engine’s thread pool (invoke threads) executes when a thread is available."

"However, the disadvantage is that there is no guarantee that it executes immediately. 
How to ensure that the one way invocations are synchronous."

If you require a synchronous-type call based on a one-way operation, then you can use the oneway Delivery Policy property


12.
Database Rows per XML Document limit the number of rows per XML message 
Database Rows per Transaction         limit the number of rows fetched 

13. MDS repository
adf-config.xml file 
File Based MDS
DB Based MDS 

How we identify MDS repository type in adf-config.xml file ?
oracle.mds.persistence.stores.file.FileMetadataStore
oracle.mds.persistence.stores.db.DBMetadataStore

14. 
ui:wsdlLocation signifies design time
binding.ws stands for runtime.

15.
JMS servers JMS servers act as management containers for the queues and topics in JMS modules that are targeted to them.
JMS Module(Optional)  contains various JMS Resources like queues, topics, etc.
Sub-Deployment(Optional) used to group target servers
                                                A subdeployment is a group of jms server and managed server.
Connection Factory is a Weblogic resource that enables JMS clients to create connections to JMS                                             destinations
Connection Pool Create a pool of connections for the JMS Adapter application.
Queue / Topic the actual destination of the message, either a queue(point to point) or                                                       topic(publish-subscribe)
queue define point to point destination type.
        used for asynchronous peer communication
topic publish subscribe model
    multiple listeners/consumer can consume the same message.
    used for asynchronous peer communication

Distributed queue
Whenever we are working on clustered environment , then we use Distributed queue. "Defines a set of queues that are distributed on multiple JMS servers, but which are accessible as a
single, logical queue to JMS clients."
Distributed topic
Whenever we are working on clustered environment , then we use Distributed Topic. 
"Defines a set of topics that are distributed on multiple JMS servers, but which are accessible as a single, logical topic to JMS clients."

16.
Default Namespace  A Namespace which does not have prefix .

17. The default values for minOccurs and maxOccurs are 1
18.
<xsl:param> The <xsl:param> element is used to declare a local or global parameter
<xsl:with-param> The <xsl:with-param> element defines the value of a parameter to be passed into a template

Note: The <xsl:with-param> element is allowed within <xsl:apply-templates> and <xsl:call-template>.

19.
Port It is a combination of a binding and a network address, providing the target address of the service communication.

Services It is a collection of related end-points encompassing the service definitions in the file;
 the services map the binding to the port and include any extensibility definitions.

20. Your composite will have 2 sections - reference & service binding. 
Your reference will point to abstract WSDL which is what is used while loading composite references during startup. 
Service binding in your SOA composite will have the actual concrete WSDL.

Binding Components: Binding  components establish a connection between a SOA composite and the external world. 

There are two types of binding components:
Exposed service and External Reference are binding component.(Responsible to interact with outer world from SOA. )
Service:
-> Creates a web service to provide an entry point to the SOA composite application
-> Services provide the outside world with an entry point to the SOA composite application.
By using WSDL.
-> The binding connectivity of the service describes the protocols that can communicate with the service,
 for example, SOAP/HTTP or a JCA adapter."

Reference
-> Creates a web service to provide access to an external service in the outside world
-> References enable messages to be sent from the SOA composite application to external
 services in the outside world."

21. getPreference()
to avoid  hard coding preference variable can be used and the value of the preference variable is accessed using getPreference().
The preference variable value can be changed without re-deploying the code via em console MBean property.

22. What is a nonBlockingAll property?
Non- blocking invoke is used when Parallel flow needs to be executed where new thread will be created for each invoke a activity and which will execute simultaneously.

23.
Jca.retry.count Specifies the maximum number of retries before rejection. Again, specifying this value                             is a pre-requisite to specifying the other property values.
Jca.retry.interval Specifies the time interval between retries (measured in seconds.)
Jca.retry.backoff Specifies the retry interval growth factor (positive integer.)

24.
If BPEL Process is Sync process then, transaction context between  client and bpel-process is controlled by ""Transaction"" Attribute. 
Values of these attributes are 1)- Required 2)- Requires New

bpel.config.transaction property.
bpel.config.transaction=required
The caller's transaction is joined (if there is one) or a new transaction is created (if there is not one)
Invoked messages are processed using the same thread in the same transaction

bpel.config.transaction=requiresNew
A new transaction is always created and an existing transaction (if there is one) is suspended.

To resolve this issue, you need to use a rethrow activity at the end of your catch all block. In this way control will go back to BPEL and it will handle transaction.

25. Config.xml 
All configuration of domain written in this file

adf-config.xml 
MDS configuration are stored in this file

26. SyncMaxWaitTime : durable (Async)

27. 
get
read only method

put,post, deletes 
write only methods

28. Difference between put and post?
Put: when you want to update a resource.
Post: when you want to create a resource.

29. Difference between put and post?
Put: when you want to update a resource.
Post: when you want to create a resource.



30 Keystores hold private keys (identity) but also public certificates (trust).
Why use keys and keystores?
->  you want to enable security measures on the transport layer
->  you want to enable security measures on the application layer
Types of keystores
JKS keystores and
KSS keystores
31. Domain
Group of weblogic server instances
32. Admin Server
central configuration controller for the entire domain
33. middelware
"Middelware is software that is used to bridge the gap between applications and others tools or database."

34.
soa_server1.out
soa_server1.log, and 
soa_server1-diagnostic.log

    soa_server1.log — SOA Suite services activity
    soa_server1-diagnostic.log— SOA Suite web tier activity

35.
We have three service Flight Service Hotel Service and Cab service, If any of them couldnt  book so what you will do for rollback all the action?
Compansate activity. And compensateScopeActivity

36.
If A call B and B call C and Response would be in Reverse manner. i.e. C respond to B and B respond to A, So how you will respod to A from C without responsding B?
Oracle BPEL Correlation Exemplified

37.
As response from an asynchronous web service is not guaranteed to be received within a specified time frame, and many instances of the same service might be invoked before even a response can be obtained, how does Oracle BPEL identify and relate the responses to the appropriate requests and proceed for completion of further activities that may be scheduled? 
"WS-Addressing"

What is WS-Addressing?
WS-Addressing evolved which contained endpoint references (EPR) and message information headers for identification.
This information is processed independently of the transport mechanism or application.
By default, Oracle BPEL PM implements WS-Addressing for all asynchronous web service calls, hence we don't have to explicitly implement identification relationship between the incoming & outgoing messages.

38.
Synchronous 
-> Request sent to application and it will be waiting until response comes back. (task should be done or acknowledge then and there itself)
-> Whenever a synchronous web service is invoked from Oracle BPEL via a partnerlink, only one port is established for communication with the exposed web service which is used by both request & response messages.
-> Immediate response for the request via a same channel(porttype & operation).

Asynchronous web services
-> when an asynchronous web service is invoked, two ports are opened for communication: one for request & one for response messages.
-> Delay in response (callback)(diffrent port type & operation)

39. If a bpel has catch and we also have policies, which will take precedence
The policies take precedence.

40. Sub Process
Inline Sub-Process
Standalone Sub-Process

41. files which is created while creating DB Adapter:
(JCA, mappings file, properties file, WSDL and XSD) 

42. Database operations like 
insert, update, delete, select, calling a stored procedure, polling records from DB and executing Pure SQL.

43. What is a Restful  Service?
REST stands for Representational State Transfer.
REST is an architecture all about client-server communication. 
In REST Architecture everything is a resource.

Restful service used the HTTP verb, For example Get, Post, Put, Delete.
It mainly deals with both type of message format JSON and XML. 
Searching any video on YouTube is a perfect example of restful service or liking/commenting/posting 


44. Scope
 a scope in BPEL can be used to group together a block of activities and limit the visibility of variables declared within that scope. 

45. CreateInstance: check the box.
If we dont check create Instance then after deployment it will throw error because their will be no instance to start the BPEL process 

46. Adapter Framework(Based on JCA):  It exposed non service system into service system.
Eg: DB,File

47. Partner link: It is link or reference to other service components. it defines a relationship between two service.  

Client Partner link: This will initiates BPEL.
Invoke/Refrence Partner link: This will be triggered by bpel.

48. How do you know whether partner link is Client Partner link or Invoke/Reference Partner link ?
-> In wsdl we can see by (MyRole , PartnerRole)

Client Partner link: This will initiates BPEL. (MyRole)
Invoke/Refrence Partner link: This will be triggered by bpel. (PartnerRole)

49. JCA adapters: 
This includes the AQ adapter, database adapter, file adapter, FTP adapter, JMS adapter, MQ adapter, socket adapter, Oracle User Messaging Service adapter, LDAP adapter, Oracle Coherence adapter, and third-party adapter.

50. What Happens When You Create a SOA Application and Project
A BPEL directory is created for BPEL processes.
A Mediators directory is created for Oracle Mediators.
A HumanTasks directory is created for human tasks.
An oracle/rules directory is created for business rules.

·         Events
Displays the business event files (.edn).
·         Schemas
Displays the BPEL process schema files (.xsd). 
Displays the test suite files.
·         Transformations
Displays the transformation XSLT (.xsl) and XQuery (.xqy) mapper files.
·         WSDLs
Displays all WSDL files (.wsdl).
·         composite_name
"A composite_name file is automatically created when you create a SOA project. 
This file describes the entire composite assembly of services, service components, references, and wires."



No comments:

Post a Comment

SOA Overview Part-1

  Middleware It provides a mechanism for the process to interact with other processes running on multiple network machines. Advantages...