Skip to content

Commit

Permalink
重构
Browse files Browse the repository at this point in the history
  • Loading branch information
闫逍旭 committed May 15, 2016
1 parent 65619a8 commit 278315f
Show file tree
Hide file tree
Showing 290 changed files with 2,936 additions and 3,259 deletions.
4 changes: 2 additions & 2 deletions conf-dev.properties
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ zk_ip=127.0.0.1:2181
zk_digest=shinemoIpo zk_digest=shinemoIpo
zk_namespace=mpush-daily zk_namespace=mpush-daily
#redis配置多个用,隔开 #redis配置多个用,隔开
redis_group=127.0.0.1:6379:shinemoIpo redis_group=111.1.57.148:6379:ShineMoIpo
#私钥 #私钥
private_key=MIIBNgIBADANBgkqhkiG9w0BAQEFAASCASAwggEcAgEAAoGBAKCE8JYKhsbydMPbiO7BJVq1pbuJWJHFxOR7L8Hv3ZVkSG4eNC8DdwAmDHYu/wadfw0ihKFm2gKDcLHp5yz5UQ8PZ8FyDYvgkrvGV0ak4nc40QDJWws621dm01e/INlGKOIStAAsxOityCLv0zm5Vf3+My/YaBvZcB5mGUsPbx8fAgEAAoGAAy0+WanRqwRHXUzt89OsupPXuNNqBlCEqgTqGAt4Nimq6Ur9u2R1KXKXUotxjp71Ubw6JbuUWvJg+5Rmd9RjT0HOUEQF3rvzEepKtaraPhV5ejEIrB+nJWNfGye4yzLdfEXJBGUQzrG+wNe13izfRNXI4dN/6Q5npzqaqv0E1CkCAQACAQACAQACAQACAQA= private_key=MIIBNgIBADANBgkqhkiG9w0BAQEFAASCASAwggEcAgEAAoGBAKCE8JYKhsbydMPbiO7BJVq1pbuJWJHFxOR7L8Hv3ZVkSG4eNC8DdwAmDHYu/wadfw0ihKFm2gKDcLHp5yz5UQ8PZ8FyDYvgkrvGV0ak4nc40QDJWws621dm01e/INlGKOIStAAsxOityCLv0zm5Vf3+My/YaBvZcB5mGUsPbx8fAgEAAoGAAy0+WanRqwRHXUzt89OsupPXuNNqBlCEqgTqGAt4Nimq6Ur9u2R1KXKXUotxjp71Ubw6JbuUWvJg+5Rmd9RjT0HOUEQF3rvzEepKtaraPhV5ejEIrB+nJWNfGye4yzLdfEXJBGUQzrG+wNe13izfRNXI4dN/6Q5npzqaqv0E1CkCAQACAQACAQACAQACAQA=
#公钥 #公钥
public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB
force_write_redis_group_info=true force_write_redis_group_info=true
#长连服务端口 #长连服务端口
connection_server_port=20882 connection_server_port=3000
#网关服务端口 #网关服务端口
gateway_server_port=4000 gateway_server_port=4000
#控制台服务端口 #控制台服务端口
Expand Down
11 changes: 6 additions & 5 deletions daily-pub.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@


BASEPATH = '/root/mpush' BASEPATH = '/root/mpush'


MPUSH_TAR_NAME = 'mpush-jar-with-dependency.tar.gz' MPUSH_TAR_NAME = 'mpush-release.tar.gz'


PROCESS_KEY_WORD = 'mpush-cs.jar' PROCESS_KEY_WORD = 'boot.jar'


GITLABPATH = '/data/localgit/mpush/mpush/target/'+MPUSH_TAR_NAME GITLABPATH = '/data/localgit/mpush/mpush-boot/target/'+MPUSH_TAR_NAME


JAVA_PATH = '/opt/shinemo/jdk1.7.0_40/bin/java' JAVA_PATH = '/opt/shinemo/jdk1.7.0_40/bin/java'


Expand Down Expand Up @@ -158,8 +158,9 @@ def main():
print showText('git pull master success','greenText') print showText('git pull master success','greenText')


##1 assembly ##1 assembly
runShell('mvn clean install assembly:assembly -P %s'%ENV) runShell('mvn clean)
print showText('assembly success','greenText') runShell('mvn package -P %s'%ENV)
print showText('package success','greenText')


##2 包创建时间 ##2 包创建时间
runShell('stat -c "%%y" %s'%GITLABPATH) runShell('stat -c "%%y" %s'%GITLABPATH)
Expand Down
20 changes: 8 additions & 12 deletions debug.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,22 +1,18 @@
#!/bin/sh #!/bin/sh


ENV=dev ENV=dev

base_dir=`pwd` base_dir=`pwd`


echo "start assembly lib..." echo "start package project..."

mvn clean
rm -rf $base_dir/target mvn package -P $ENV

mvn clean install assembly:assembly -P $ENV


echo "start tar mpush..." echo "start tar mpush..."
cd $base_dir/target cd $base_dir/mpush-boot/target
tar -xzvf ./mpush-jar-with-dependency.tar.gz tar -xzvf ./mpush-release.tar.gz
echo "start start mpush..."

cd mpush/lib


java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7998 -Dio.netty.leakDetectionLevel=advanced -jar $base_dir/target/mpush/mpush-cs.jar & echo "start start mpush..."
cd mpush
java -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7998 -Dio.netty.leakDetectionLevel=advanced -jar boot.jar &


echo "end start mpush..." echo "end start mpush..."
7 changes: 4 additions & 3 deletions mpush-api/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>mpush</artifactId> <artifactId>mpush</artifactId>
<groupId>com.shinemo.mpush</groupId> <groupId>com.mpush</groupId>
<version>0.0.0.2</version> <version>1.0</version>
<relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>


<groupId>${mpush.groupId}</groupId>
<artifactId>mpush-api</artifactId> <artifactId>mpush-api</artifactId>
<version>${mpush-api-version}</version>
<name>mpush-api</name> <name>mpush-api</name>
<packaging>jar</packaging> <packaging>jar</packaging>


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.shinemo.mpush.api; package com.mpush.api;


import com.mpush.api.connection.Connection;
import io.netty.channel.Channel; import io.netty.channel.Channel;


import com.shinemo.mpush.api.connection.Connection;



public interface Client { public interface Client {


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api; package com.mpush.api;


import java.nio.charset.Charset; import java.nio.charset.Charset;


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.shinemo.mpush.api; package com.mpush.api;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.protocol.Packet;
import com.shinemo.mpush.api.protocol.Packet; import com.mpush.api.connection.Connection;
import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelFutureListener;


/** /**
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.shinemo.mpush.api; package com.mpush.api;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.protocol.Packet;
import com.shinemo.mpush.api.protocol.Packet; import com.mpush.api.connection.Connection;


/** /**
* Created by ohun on 2015/12/22. * Created by ohun on 2015/12/22.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.shinemo.mpush.api; package com.mpush.api;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.protocol.Packet;
import com.shinemo.mpush.api.protocol.Packet; import com.mpush.api.connection.Connection;


/** /**
* Created by ohun on 2015/12/22. * Created by ohun on 2015/12/22.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api; package com.mpush.api;


import java.io.Serializable; import java.io.Serializable;


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api; package com.mpush.api;


import java.util.Collection; import java.util.Collection;


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api; package com.mpush.api;


public final class RedisKey { public final class RedisKey {


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api; package com.mpush.api;


/** /**
* Created by ohun on 2015/12/24. * Created by ohun on 2015/12/24.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.connection; package com.mpush.api.connection;


/** /**
* Created by ohun on 2015/12/28. * Created by ohun on 2015/12/28.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.shinemo.mpush.api.connection; package com.mpush.api.connection;


import com.mpush.api.protocol.Packet;
import io.netty.channel.Channel; import io.netty.channel.Channel;


import com.shinemo.mpush.api.protocol.Packet;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelFutureListener;


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.connection; package com.mpush.api.connection;


import java.util.List; import java.util.List;


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.connection; package com.mpush.api.connection;


/** /**
* Created by ohun on 2015/12/22. * Created by ohun on 2015/12/22.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.connection.Connection;


/** /**
* Created by ohun on 2016/1/10. * Created by ohun on 2016/1/10.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


/** /**
* Created by ohun on 2015/12/29. * Created by ohun on 2015/12/29.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.connection.Connection;


/** /**
* Created by ohun on 2015/12/29. * Created by ohun on 2015/12/29.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


/** /**
* Created by ohun on 2015/12/29. * Created by ohun on 2015/12/29.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


import com.shinemo.mpush.api.router.Router; import com.mpush.api.router.Router;


/** /**
* Created by ohun on 2016/1/4. * Created by ohun on 2016/1/4.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.connection.Connection;


/** /**
* 链接超时,用户解绑的时候,用户主动关闭链接,才会触发该事件 * 链接超时,用户解绑的时候,用户主动关闭链接,才会触发该事件
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.event; package com.mpush.api.event;


import com.shinemo.mpush.api.connection.Connection; import com.mpush.api.connection.Connection;


/** /**
* 绑定用户的时候才会触发该事件 * 绑定用户的时候才会触发该事件
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.exception; package com.mpush.api.exception;


/** /**
* Created by ohun on 2015/12/23. * Created by ohun on 2015/12/23.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.exception; package com.mpush.api.exception;


/** /**
* Created by ohun on 2015/12/23. * Created by ohun on 2015/12/23.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.exception; package com.mpush.api.exception;


public class MessageException extends RuntimeException { public class MessageException extends RuntimeException {


Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.exception; package com.mpush.api.exception;


/** /**
* Created by ohun on 2015/12/30. * Created by ohun on 2015/12/30.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.protocol; package com.mpush.api.protocol;


/** /**
* Created by ohun on 2015/12/22. * Created by ohun on 2015/12/22.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.protocol; package com.mpush.api.protocol;


import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shinemo.mpush.api.router; package com.mpush.api.router;


import com.shinemo.mpush.api.connection.SessionContext; import com.mpush.api.connection.SessionContext;


/** /**
* Created by ohun on 2015/12/23. * Created by ohun on 2015/12/23.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.router; package com.mpush.api.router;


/** /**
* Created by ohun on 2015/12/23. * Created by ohun on 2015/12/23.
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shinemo.mpush.api.router; package com.mpush.api.router;


/** /**
* Created by ohun on 2015/12/23. * Created by ohun on 2015/12/23.
Expand Down
15 changes: 4 additions & 11 deletions assembly.xml → mpush-boot/assembly.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,32 +3,25 @@
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>jar-with-dependency</id> <id>release</id>
<baseDirectory>mpush</baseDirectory> <baseDirectory>mpush</baseDirectory>
<includeBaseDirectory>true</includeBaseDirectory> <includeBaseDirectory>true</includeBaseDirectory>
<formats> <formats>
<format>tar.gz</format> <format>tar.gz</format>
</formats> </formats>
<fileSets> <fileSets>
<fileSet> <fileSet>
<directory>mpush-cs/target/classes/</directory> <directory>target/classes/</directory>
<outputDirectory/> <outputDirectory/>
<includes> <includes>
<include>config.properties</include> <include>config.properties</include>
</includes> </includes>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>mpush-cs/target/</directory> <directory>target/</directory>
<outputDirectory/> <outputDirectory/>
<includes> <includes>
<include>lib/*.jar</include> <include>boot.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>mpush-cs/target/</directory>
<outputDirectory/>
<includes>
<include>mpush-cs.jar</include>
</includes> </includes>
</fileSet> </fileSet>
</fileSets> </fileSets>
Expand Down
Loading

0 comments on commit 278315f

Please sign in to comment.