You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/09/03 06:18:44 UTC

[GitHub] chickenlj closed pull request #108: Document Translation

chickenlj closed pull request #108: Document Translation
URL: https://github.com/apache/incubator-dubbo-website/pull/108
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/blog/en-us/hostname.md b/blog/en-us/hostname.md
new file mode 100644
index 00000000..a3400f80
--- /dev/null
+++ b/blog/en-us/hostname.md
@@ -0,0 +1,24 @@
+## Background
+
+In the docker bridge network mode, you need to specify the registration host IP to implement external network communication. Dubbo which are used to set the ip and port addresses for external communication provides two pairs of system attributes for the startup phase.
+
+- DUBBO_IP_TO_REGISTRY --- IP address registered to the registry 
+- DUBBO_PORT_TO_REGISTRY --- Port port registered to the registry
+- DUBBO_IP_TO_BIND --- Monitor ip address  
+- DUBBO_PORT_TO_BIND --- Monitor Port port
+
+## Default Value
+
+1. The four configuration items above are optional. If you do not configure dubbo, you will get IP and port automatically. Please choose the configuration flexibly according to the specific deployment scenario.
+2. Dubbo supports multiple protocols. If an application exposes multiple different protocol services at the same time and needs to specify ip or port separately for each service, add the protocol prefix before the above attributes. Such as:
+	- HESSIAN_DUBBO_PORT_TO_BIND  Port bound by hessian protocol
+    - DUBBO_DUBBO_PORT_TO_BIND   Port bound by dubbo protocol
+	- HESSIAN_DUBBO_IP_TO_REGISTRY  IP registered in hessian protocol
+	- DUBBO_DUBBO_PORT_TO_BIND    IP registered in dubbo protocol
+3.  PORT_TO_REGISTRY or IP_TO_REGISTRY will not be used as the default value of PORT_TO_BIND or IP_TO_BIND, but the reverse is true
+	-  If we set PORT_TO_REGISTRY=20881, IP_TO_REGISTRY=30.5.97.6, PORT_TO_BIND IP_TO_BIND will not be affected
+	-  If we set PORT_TO_BIND=20881 IP_TO_BIND=30.5.97.6, default PORT_TO_REGISTRY=20881 IP_TO_REGISTRY=30.5.97.6
+
+## Conclusion
+
+We can use `host` property to set the host value. It support **IP and domain name**.
\ No newline at end of file
diff --git a/docs/en-us/user/demos/serialization.md b/docs/en-us/user/demos/serialization.md
new file mode 100644
index 00000000..5bbbf3d1
--- /dev/null
+++ b/docs/en-us/user/demos/serialization.md
@@ -0,0 +1,73 @@
+## Enable Kryo and FST
+Using Kryo and FST is very simple, just add an attribute to the dubbo RPC XML configurition:
+
+```xml
+<dubbo:protocol name="dubbo" serialization="kryo"/>
+```
+
+```xml
+<dubbo:protocol name="dubbo" serialization="fst"/>
+```
+## <span data-type="color" style="color:#262626">Register serialized class</span>
+For releasing the high ability of Kryo and FST, it's best to register the classes that need serializing into the dubbo system. For example, we can implement the following callback interface:
+
+```java
+public class SerializationOptimizerImpl implements SerializationOptimizer {
+
+    public Collection<Class> getSerializableClasses() {
+        List<Class> classes = new LinkedList<Class>();
+        classes.add(BidRequest.class);
+        classes.add(BidResponse.class);
+        classes.add(Device.class);
+        classes.add(Geo.class);
+        classes.add(Impression.class);
+        classes.add(SeatBid.class);
+        return classes;
+    }
+}
+```
+
+And then add in the XML configuration:
+
+```xml
+<dubbo:protocol name="dubbo" serialization="kryo" optimizer="com.alibaba.dubbo.demo.SerializationOptimizerImpl"/>
+```
+
+After registering these classes, serialized performance may be greatly improved, especially for the small numbers of nested objects.
+
+Of course, when serializing a class, you may cascade to reference many classes, such as Java collection classes. For this situation, we have automatically registered the commonly used classes in the JDK, so you don't have to register them repeatedly (of course, it doesn't matter if you do), including:
+
+```xml
+GregorianCalendar
+InvocationHandler
+BigDecimal
+BigInteger
+Pattern
+BitSet
+URI
+UUID
+HashMap
+ArrayList
+LinkedList
+HashSet
+TreeSet
+Hashtable
+Date
+Calendar
+ConcurrentHashMap
+SimpleDateFormat
+Vector
+BitSet
+StringBuffer
+StringBuilder
+Object
+Object[]
+String[]
+byte[]
+char[]
+int[]
+float[]
+double[]
+```
+
+It doesn't matter if you forget to register some classes, as the registering serialized classes are only for performance optimization. In fact, even without registering any classes, the performance of Kryo and FST is generally better than hessian and dubbo serialization.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org