21
Migration to Mobicents SIP Servlets Mobicents Summit 2012 Rio de Janeiro, Brazil

Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Migration to Mobicents SIP Servlets

Mobicents Summit 2012Rio de Janeiro, Brazil

Page 2: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

● Founded in 2003

● Privately held

● Operations in 150 countries

● Corporate headquarters in Miami, Florida

● Technical facilities in Virginia, Brazil, Argentina

● Four primary lines of business

● InPhonex Business including

● InPhonex Resale

● InPhonex Personal

● InPhonex Platform Solutions

Page 3: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

● Currently using the old BEA's WebLogic 3.1○ JSR116○ Old version of JRockit○ Bugs, etc.

Looking for alternatives, we wanted a more dynamic solution. ● Open Source● Active Maintainers● Active Community● Support● Response time for reported issues● Range of products

○ Mobicents SIP Servlets○ RestComm○ Media Server

Reasons to Migrate

Page 4: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Now to the details of the migration...

Page 5: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Descriptor Changes

BEA is older and sip.xml doctype is from previous spec

<!DOCTYPE sip-app PUBLIC "-//Java Community Process//DTD SIP Application 1.0//EN" "sip-app_1_0.dtd">● Moved from servlet-mapping to servlet-selection to

allow further configuration from the management console

● Overall refactoring to avoid having to rely on the BEA JNDI.

Page 6: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Descriptor Changes

web.xml doctype is from previous spec

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

● Everything else is the same

Page 7: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Application code changes

● In BEA HTTP sessions are eagerly created so request.getSession().invalidate() is required, but in JBoss it throws exception because it is lazy-created

● Derived sessions are invalidated together in BEA, in Mobicents they continue separately

● Change the datasource JNDI lookup code● MAX_LISTENER_RESPONSE_TIME

because of long 183s● Can not bind object to session that has been

invalidated!!

Page 8: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Database configuration

● Add the mysql driver in the server/default/lib directory● JBoss has completely different datasource deployment

descriptors and configuration (see route-ds.xml)● BEA connection pooling vs DBCP (overall 90% the

same options with different names)● BEA connection load balancing vs mysql JDBC driver

built-in load balancing vs JBoss load balancing (large topic)

● In the end the mysql driver can do equivalent load balancing of the writes with jdbc:mysql:loadbalance://host1,host2/database

Page 9: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

JBoss 7 datasources

● Completely different from JBoss 5 datasource descriptors

● Still uses DBCP, but the configuration file syntax is different

Page 10: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

BEA IDE project

The original inphonex project was Eclipse WTP project with self-contained dependencies and some BEA dependencies.

Page 11: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Moving to Maven

● By far the most difficult task.● Swap the bea sip servlet api jar with the

mobicents sip servlet api jar● Hunting down the required dependencies

with google● Must use mvn clean war:inplace war:war

install to be sure the build is refreshed○ simply doing war:war caches an older copy

sometimes

Page 12: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Logging

● Three completely different logging configurations○ JBoss AS 5 (log4j xml)○ JBoss AS 7 (jboss logging + log4j behind it)○ Tomcat (log4j propeties)

Page 13: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Logging in JBoss 5

● In Mobicents STDOUT logging is rendered only as much as log4j allows, so application logging was moved to log4j

● Log4j configuration entries may need to be added to jboss-log4j.xml for the app

● Of course the logging output is completely different than BEA and log4j must be mastered

Page 14: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

JBoss AS 7 Logging

● Different from the JBoss 5 logging● Centralized configuration● https://community.jboss.

org/wiki/JBossAS7Logging● Use admin console at http://127.0.0.1:9990 to

make quick edits that take effect immediately○ Output handlers○ Categories○ Levels○ Somewhat like Oracle/BEA

Page 15: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

How to isolate only the inphonex logging into separate file

Know your category and level<category name="com.inphonex">

<priority value="DEBUG"/><appender-ref ref="MY_OWN_APPENDER"/>

</category>

Make sure the appender and root thresholds allow your level of logging<appender name="MY_OWN_APPENDER" class="org.jboss.logging.appender.DailyRollingFileAppender">

<param name="File" value="/log/inphonex.log"/><param name="Threshold" value="DEBUG"/>

Page 16: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

JRockit vs Hotspot

● Most settings are portable between the JVMs, but JRockit management configuration is different and it lacks some diagnostic options

● The hotspot parallel garbage collection with incremental CMS seems just as capable as jrockits for the current load

● The garbage collection patterns are different

Page 17: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

JVM options

Hotspot 1.6 anyJAVA_OPTS="-Xms2g -Xmx2g -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+HeapDumpOnOutOfMemoryError -XX:PermSize=128M -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

JRockit R27.4.0-jdk1.5.0_12-server -Xms2048m -Xmx2048m -Xgc:gencon -XXnosystemgc -XXtlasize:min=3k -XXkeeparearatio=0 -Xns:40m -Xmanagement:ssl=false,authenticate=false,port=7091 -XXdisableFatSpin -XX:+HeapDumpOnOutOfMemoryError -XX:-UseFatSpin -XX:+HeapDiagnosticsOnOutOfMemoryError

(only available in R28, so no luck with those)

Page 18: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Management and Monitoring for Mobicents

● jconsole - JMX monitoring and management and JVM stats

● http://127.0.0.1:8080/jmx-console - same with Web UI● http://127.0.0.1:8080/sip-servlets-management - Sip

Servlets specific administration● http://127.0.0.1:8080/admin-console - JBoss global

administration Web console● twiddle - command line tool for JMX management● http://127.0.0.1:9990 - JBoss 7 is much more like

BEA, can configure the datasources in similar way● JBoss 7 suffers from https://issues.jboss.

org/browse/JBAS-7427○ many hacks are needed to have a working JMX!

Page 19: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Management and Monitoring for JRockit and BEA

● JRockit Mission Control - glorified jconsole● http://127.0.0.1:7001/console/console.portal

○ Unified Web UI for the BEA server, including SIP● Command line

○ Mission control from the command line (jrmc)○ Application server administration from the command

line○ jrcmd - replaces the Hotspot JDK tools such as jps,

jstack and so on

Page 20: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Questions?

Page 21: Mobicents Summit 2012 - Silvano Girardi - InPhonex's migration to Mobicents Sip Servlets

Thank you!