| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
www.pubnub.com - PubNub Real-time Push Service in the Cloud.
Please reference the demo app in jars/PubnubDemoConsole.jar for an example of using PubNub Asyncronously in your applications!
Additional Java docs are available at doc/index.html
###To browse source Checkout srcPubnubApi
###To setup with your IDE: Check out the Eclipse video walkthrough here!
###To build from the CL, run:
$ ant clean build $ ant
###To test from the CL, run:
$ ant test
###To be really cool and clean, build, and test at once!
$ ant clean build test
A quick video demo of building with ant from the command line can be viewed here. ###Configuring Logging
Check out the logging video walkthrough here!
Pubnub implements swappable logging using SLF4J, which allows you to switch different logging frameworks easily. All the logging calls using SLF4J API will be delegated to the underlying logging framework.
Before you enable logging, you need to create a "debug-build" version of the Pubnub-StandardEdition.jar.
####To create a debug-build
To implement logging using log4j you need to add the following references to the project. Using log4j you can log to console or a file or both.
For example, in your log4j.properties file, configure it to write the logs to a log file:
# Root logger option
log4j.rootLogger=ALL, FILE
# Direct log messages to a log file
log4j.appender.FILE =org.apache.log4j.FileAppender
log4j.appender.FILE.File=/Users/rajat/Projects/eclipsews/log4jloging.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%nMore info can be found here http://www.tutorialspoint.com/log4j/log4j_configuration.htm
ii) To implement logging using simple slf4j you need to add the following references to the project
iii) To implement logging using logback-classic you need to add the following references to the project
iv) To implement logging using java.util.logging you need to add the following references to the project
v) To implement logging using commons-logging you need to add the following references to the project
vi) To implement no logging you have two options
Option 1:
Option 2:
More info on SLF4J can be found at http://stackoverflow.com/questions/8737204/how-slf4j-works-no-log-getting-created
###To run the DemoConsole:
$ cd jars $ java -jar PubnubDemoConsole.jar
###Heres an example of running PubnubDemoConsole:
$~/pubnub/java/java/jars$ java -jar PubnubDemoConsole.jar HINT: To test Re-connect and catch-up Disconnect your machine from network/internet and re-connect your machine after sometime Enable SSL ? Enter Y for Yes, else N N SSL not enabled Enter cipher key for encryption feature If you don't want to avail at this time, press ENTER No Cipher key provided ENTER 1 FOR Subscribe (Currently subscribed to no channels.) ENTER 2 FOR Publish ENTER 3 FOR Presence ENTER 4 FOR Detailed History ENTER 5 FOR Here_Now ENTER 6 FOR Unsubscribe ENTER 7 FOR Presence-Unsubscribe ENTER 8 FOR Time ENTER 9 FOR EXIT OR QUIT ENTER 10 FOR Disconnect-And-Resubscribe ENTER 11 FOR Toggle Resume On Reconnect ENTER 0 to display this menu 1 Subscribe: Enter Channel name hello_world Subscribed to following channels: hello_world ENTER 1 FOR Subscribe (Currently subscribed to hello_world) ENTER 2 FOR Publish ENTER 3 FOR Presence ENTER 4 FOR Detailed History ENTER 5 FOR Here_Now ENTER 6 FOR Unsubscribe ENTER 7 FOR Presence-Unsubscribe ENTER 8 FOR Time ENTER 9 FOR EXIT OR QUIT ENTER 10 FOR Disconnect-And-Resubscribe ENTER 11 FOR Toggle Resume On Reconnect ENTER 0 to display this menu SUBSCRIBE : CONNECT on channel:hello_world 1 Subscribe: Enter Channel name my_channel Subscribed to following channels: hello_world : my_channel ENTER 1 FOR Subscribe (Currently subscribed to hello_world,my_channel) ENTER 2 FOR Publish ENTER 3 FOR Presence ENTER 4 FOR Detailed History ENTER 5 FOR Here_Now ENTER 6 FOR Unsubscribe ENTER 7 FOR Presence-Unsubscribe ENTER 8 FOR Time ENTER 9 FOR EXIT OR QUIT ENTER 10 FOR Disconnect-And-Resubscribe ENTER 11 FOR Toggle Resume On Reconnect ENTER 0 to display this menu SUBSCRIBE : CONNECT on channel:my_channel 2 Publish: Enter Channel name hello_world Enter the message for publish. To exit loop enter QUIT "hello, world!" PUBLISH : [1,"Sent","13597534956712683"] SUBSCRIBE : hello_world : class java.lang.String : hello, world! SUBSCRIBE : hello_world : class java.lang.String : 3ZoxkVMB97lf09jpFU9gtw== SUBSCRIBE : hello_world : class java.lang.String : 3ZoxkVMB97lf09jpFU9gtw==
| Back | FazBrowse Home | New Git URL |